Native nesting without Sass. Write nested CSS, see what the browser read: each rule’s flat selector, its specificity, the elements it hits, and the fate of a…
Nesting now works in every modern browser without Sass. But & in real CSS is a selector, not a piece of text: &.laris differs from & .laris, &__nama is dropped, and a list as the parent raises specificity. Knowing this keeps your CSS short without surprises.
& is the parent selector, not a piece of text
&__nama, and the title does not change In real CSS & is a selector, not a piece of text: &__nama is invalid and dropped. Write the class name in full: .kain__nama { … } (or & .kain__nama) inside .kain.& .laris misses an element with two classes A space is the descendant combinator. &.laris (no space) = .kain.laris: the same element. & .laris = .kain .laris: a child inside it. The same goes for &:hover and & :hover.& reads as :is(parent), which takes the highest specificity in its parent list: under .kain, #promo, & a weighs as much as #promo a (1,0,1) for all its links. Nesting does not soften specificity; keep it 2–3 levels deep, and use @layer to decide who wins between big sections.p { margin: 0; } inside .kain. The tree shows the browser writes it & p, and how many elements it hits.& a under .kain, #promo becomes :is(.kain, #promo) a = (1,0,1). See who wins on the card link: the .kain a rule (0,1,1) written later still loses.