top | item 38791480

Some of the future is now for CSS

29 points| Looky1173 | 2 years ago |brycewray.com

3 comments

order

brycewray|2 years ago

Post author here. Two things I would add, given that the post is now nearing a year old:

1. Many people are unable to update to browsers which support the latest features, so developers must continue to practice “defensive CSS” for quite some time yet. Ways to do so include Sass, Lightning CSS, and PostCSS.

2. For those who know their audience is using updated browsers, be advised the nesting syntax is now more relaxed[0] and, like Sass nesting, generally *doesn’t* require the `&` stuff (which *does* still work, though).

[0]: https://developer.chrome.com/blog/css-nesting-relaxed-syntax...

CM30|2 years ago

Damn, didn't know there was a proposal for Sass like environmental variables that can be used in media queries:

https://drafts.csswg.org/css-env-1/

So in future, at least one of the limitations mentioned in this post will be fixed.

Either way, I'm also happy to see CSS Nesting get more and more browser support, and more things that were previously limited to preprocessors get added to vanilla CSS.

threatofrain|2 years ago

Media queries is the last reason I'm still using Sass, although I think the pendulum still has more room to swing in the compile-time direction for optimizations like de-duplication.