Will Boyd @codersblock.com 路 Dec 3

I'm curious how many people didn't realize this 馃憞 #CSS nesting is natively supported in all major browsers. The following works as-is, no SCSS preprocessing needed.

21 likes 7 replies

?

Replies

Earth to Bob 路 Dec 3

I've been day-dreaming forever for this it feels!

@nyc4m.bsky.social 路 Dec 3

Too few people are aware of this. Unfortunately you cannot use the & as a prefix for css names as you can do with scss or less 馃槩

Sam Rose 路 Dec 3

Annoyingly not supported in Floorp or Kiwi, which are apparently browsers that enough people who read my posts use for me to know about and aim to support 馃槄

Jesse Andrews 路 Dec 3

I didn鈥檛 realize! That鈥檚 awesome

idiotic.dev 路 Dec 3

Shut the front door 馃槺

Josh Collinsworth 路 Dec 3

One caveat to be aware of: some versions of Safari require the `&` in front of element selectors. So, for widest support (for now), it would need to be: ``` article { & h1 { /* stuff */ } } ``` You only need it with plain element selectors, though; not classes, IDs, etc.