The 3rd party CSS tooling can pick whatever syntax it wants because it is starting on a green field. Browser probably can't?
Otherwise just use sass, it is well-liked and proven. Or, as you suggest, do nothing.
Because time and again userland implementations of useful functionality are better, more ergonomic and practical than anything committees come up with.
- the nested CSS proposal supports everything the SCSS syntax does, plus some potentially useful combinations
- the SCSS syntax would literally lead to a worse user experience, both for the end user whose browsing performance is now degraded, and anyone implementing parsers for CSS (since the infinite lookahead is quite a bit more complicated)
- the committee isn't just "coming up" with the new syntax, they are asking for feedback. Let's not pretend this is the same as a committee deciding something without taking input from the affected users.
I understand that generally a de facto standard will be more useful than a de jure one. But this isn't some committee coming up with their own convoluted version of a standard because of NIH - they are communicating clearly and openly around why the established standard would be problematic. Shouldn't we as a technical community try to find the best solution for the problems we face, instead of taking principled stands and ignoring the technical hurdles in our way?
If you resolve the ambiguity in real time in favor of the preprocessor syntax, you break existing websites.
If you perform a preprocessing step it now blocks CSS parsing and slows down all websites on the internet.
Maybe the preprocessor authors should have thought harder about their syntax if they wanted it to be adopted as a web standard.
It's feasible when you're running a preprocessor on your own code one time, but not feasible for the browser to do on unknown code on every stylesheet it encounters.
But finding 3 other solutions (because of "performance"), not promoting them through transpiling, and then forcing them on web devs seems... googley. Not the first improvement they forced down our throats and unfortunately not the last. /rant
.block {
&__element {
&--modifier {
p: v;
}
}
}
for getting .block__element--modifier { p: v; }
could really be problematic from CSS parser perspective. Also in SASS `&` really is kinda placeholder and I think you can do stuff like .x { &+&+& { p:v; } }
to get .x + .x + .x { p: v; }
what again seems problematic. (But again, I don't say I've grasped that fully.)[1] https://twitter.com/jaffathecake/status/1552200992179077126 [2] https://developer.chrome.com/blog/help-css-nesting/#:~:text=...