Comment

Comment by JimDabell

Vanilla CSS already has support for nesting and variables that are more flexible than this, cascade properly at runtime, and are available to alter with JavaScript at runtime. I don’t think it’s a good idea to reinvent that with a preprocessor.

Vanilla CSS doesn’t have mixins, but generally speaking those aren’t all that helpful anyway, there’s often a better way to achieve what you want using some combination of other HTML/CSS features.

I’m more inclined to write vanilla CSS and use Lightning CSS (also implemented in Rust) to transcode for backward compatibility with older browsers. Lightning also supports mixins via the compose property if you really want them, although that’s not standard CSS.

https://lightningcss.dev

parent JimDabell 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton