sm

CSS nesting is (almost) ready

I've been hearing a lot about CSS nesting, but I figured that it was still years away from being ready for use even on a site like this.

But a quick check of Can I Use shows that it is ready in all major browsers. Even more if you make sure to use the & nesting selector.

Try it out for yourself:

View this interactive on seanmcp.com

So should you start using CSS nesting today? Probably not. But it is almost ready, and that's exciting. Variables and nesting are the two features that would still draw me to a preprocessor like Sass or Less. We've had native custom properties for years, and now we are so close to being able to use nesting.

Exciting times!

Reply by email Psalm 104:16-17 Category Articles

Photo of Sean McPherson

Sean McPherson works as a software engineer at Khan Academy, and enjoys playing games and watching soccer. He lives with family in Pittsburgh, PA.