by lycos · 2y ago · 0 comments
I feel like purists who write CSS by hand don't want this kind of stuff, because otherwise they'd have switched to one of thousands of preprocessors. And people who use preprocessors and/or elaborate styling systems that take care of this stuff already.
Maybe I am getting too old and out of touch though.
After those the major use-case for JS preprocessors will for most use-cases only be bundling and minification.
I wouldn't need Sass if mixins were implemented in CSS.
It might not eliminate it for everyone, but it will for those who care.
Maybe you still use PostCSS for some auto prefixing/ backwards compat stuff but the need for that should go away as the usage numbers for unsupported browsers go down.
The more universally executable code you have to run in a low-trust environment which is a WWW document, the more interesting vulnerabilities can creep in.
It's too late though: https://portswigger.net/research/ublock-i-exfiltrate-exploit...
Which browsers that matter aren't evergreen at this point?
EDIT: got an answer downthread, apparently at least some sites have to deal with old versions of the mobile Safari engine because of old iPhones/iPads that can't be updated and can't run other browser engines. Another good reason to wish that iPhones/iPads permitted other browsers.
This is the most important question nowadays. there are still organizations where this is tightly controlled, they use LTS releases that don't always get the updates as fast or the same etc.
Safari on iOS, which is still tied to the OS version and not evergreen yet.
Its not always appropriate but I feel CSS benefits more often than not for this
So I use mixins for style reuse so that I can always look at the component CSS (and follow any explicit imports) to see what styles are applied. If you have some styles from utility classes and some from component-level styles, there's always increased cognitive load because when you're looking at the component CSS you often don't realize that the utility class is there.
I get the sense that this is one of the reasons why people like Tailwind. Then there's no confusion - everything is in utility classes, in one place. But I can't read that mess. I need line breaks and separation of concerns. That's just me.
This proposal kind of scratches my itch, but from what I can tell, these functions and mixins are still globally defined, so while they're better than utility classes, they still leave a bit to be desired for me. I'd like CSS to behave like any reasonable language and use explicit imports. But I'm sure that getting imports right and avoiding blocking is not an easy problem.
SASS is 16 years now. Less is 15. PostCSS is 10. That it took CSS WG this long to adopt useful features from those tools reflects quite poorly on the browsers.
I wish it was also stacked like SCSS. Maybe some day.
Yes, because the fewer things you depend on outside of the standard, the better.
I like standards, but my recent foray into FE development showed me that FE is an unmitigated disaster. Standardising helps that.