A CSS parser, transformer, and minifier written in Rust.
Nice. The CSS world could use a little processing shake up like this.
Close! It looks like it doesn’t do bundling (standalone anyway). I suppose it would have to just invent a syntax for that, as I think Sass somewhat regrets the ambiguity of how it uses
@import just like native CSS does and I wouldn’t blame anyone for not wanting to go down that road. It’s tricky territory, for sure, as inventing syntax kinda puts it into a different category of tool. I think it would be worth it though, as breaking up CSS into smaller files but bundling them in development is like… a thing people do, and I could see really wanting to use this without having to necessarily commit to Parcel (which can bundle).
So why run your CSS through this thing? From the docs, it looks like you’d wanna do that because…
- it’s a minifier,
- it does vendor prefixing,
- it can process as CSS modules (the classic library, not the native ones), and
- you get sourcemaps.
(Originally, I thought it leveraged other tools for these tasks as tools like Autoprefixer and cssnano appeared in the project’s
package.json file, but as the comment below from Devon confirms, Parcel CSS is a replacement for these, it doesn’t use them.)
And crucially, it’s fast:
Will Parcel CSS become an ecosystem?
So I guess the big question is: If Parcel CSS becomes the CSS parser of choice, will we get plugins? And if we do, will it become a robust ecosystem like PostCSS plugins?