Earlier 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…
Parcel CSS: A new CSS parser, compiler, and minifier
21–30 of 129 posts
Re: Parcel CSS: A new CSS parser, compiler, and minifier
#22Earlier 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…
Re: Parcel CSS: A new CSS parser, compiler, and minifier
#23Earlier 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…
Re: Parcel CSS: A new CSS parser, compiler, and minifier
#24Earlier 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…
Re: Parcel CSS: A new CSS parser, compiler, and minifier
#25Re: Parcel CSS: A new CSS parser, compiler, and minifier
#26Re: Parcel CSS: A new CSS parser, compiler, and minifier
#27Re: Parcel CSS: A new CSS parser, compiler, and minifier
#28> Parcel CSS is based on the cssparser[0] Rust crate, a browser-grade CSS tokenizer created by Mozilla and used in Firefox. This provides a solid foundation, including tokenization and basic parsing. However, it does not interpret any CSS properties or at rules. That's where Parcel CSS comes in. It handles parsing each individual rule and property value, as well as minification, compilation, and printing back to CSS.…
Re: Parcel CSS: A new CSS parser, compiler, and minifier
#29I feel stupid asking this question, but isn't the browser that parses css? i understand minifying css, but what does parcel's css parsing refer to?
Re: Parcel CSS: A new CSS parser, compiler, and minifier
#30Earlier quoted context omitted.
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…
More importantly, I would expect #00ff00 to compress better than green, because it would usually make the CSS file more predictably repetitive. Reducing network bytes is usually very important for speeding up loading (at least it is in the boondocks of the internet - out at the rim of the world).