Parcel CSS: A new CSS parser, compiler, and minifier
51–60 of 129 posts
Re: Parcel CSS: A new CSS parser, compiler, and minifier
#52Earlier quoted context omitted.
Because the hex for green (#00ff00) needs more letters than using the named color.
That's an... interesting optimization, and one that might make sense if you only care about byte size, but intuition (which might be wrong!) tells me that this will be more expensive (especially if it saves only one or two bytes). I'd bet that browsers can more quickly parse a string like '0x00ff00' into its internal color representation than it can parse the string 'green'. It's probably faster to check for a '0x' p…
A minimizer should care a lot abut size. I'm not sure what would be faster, but the difference must be minimal anyway, so it's safe to focus on your default concern.
Re: Parcel CSS: A new CSS parser, compiler, and minifier
#53I nearly didn't look at this because I didn't want another javascript dependance in my pipeline.
Re: Parcel CSS: A new CSS parser, compiler, and minifier
#54Why is a product written in Rust have “JS” (javascript) in its URL name? I nearly didn't look at this because I didn't want another javascript dependance in my pipeline.
Re: Parcel CSS: A new CSS parser, compiler, and minifier
#55Unrelated but regarding SCSS/SASS: I am curious, why did we invent a new syntax for scss instead of writing a library in Python or Go that maps data-objects to CSS classes? You have full access to a proper programming language instead of this new DSL we need to learn. I tried searching for it but no luck, any reason why we don't do this?
Re: Parcel CSS: A new CSS parser, compiler, and minifier
#56What does it mean to compile CSS? Pack multiple files into one? Resolve and inline variables? Convert nested rules into flat CSS? Something else? I'm really not sure.
Re: Parcel CSS: A new CSS parser, compiler, and minifier
#57What does it mean to compile CSS? Pack multiple files into one? Resolve and inline variables? Convert nested rules into flat CSS? Something else? I'm really not sure.
[0] https://www.goodreads.com/book/show/52320048-abstracting-awa...
Re: Parcel CSS: A new CSS parser, compiler, and minifier
#58Re: Parcel CSS: A new CSS parser, compiler, and minifier
#59This is amazing! Seen a lot of work around Rust and JS / JSX / TS / TSX (notably SWC[0] is moving to be a Rust based version of Babel) not so much around CSS. My genunine hope is this will replace PostCSS sooner rather than later. PostCSS isn't the most performant thing I've worked with, and a lot of plugins for PostCSS rely on doing multiple passes at the AST, they can slow down significantly as a result For that ho…
Hi, author of Parcel CSS here. I have been thinking about implementing the CSS OM spec as the JS API. This is the same API that browsers expose for manipulating stylesheets. The advantage of this is that we don't need to invent something custom. Still thinking through options. https://github.com/parcel-bundler/parcel-css/issues/5 That said, I think I'd want to keep the use cases for JS plugins limited, because it wil…
Most of CSS OM is already implemented in Javascript which can come in handy for this project:
https://github.com/jsdom/cssstyle
(both of which jsdom use internally. cssstyle is a kind of updated version for some parts of CSSOM)