Live data from Hacker News

What CSS minifiers also leave behind

luisant.ca

1–10 of 109 posts

Re: What CSS minifiers also leave behind

#2
I'm for hire now. Le Sigh. Email's in the footer.

Remy: I'd suggest posting a CV and linking to it from this post. I looked and couldn't find one anywhere on your site; you'll get a lot more qualified interest if people can find out more about you than just a few blog posts.

Re: What CSS minifiers also leave behind

#3
The scientific notation one is a bug. Scientific notation isn't part of the CSS spec[1], and its not supported in all browsers.

I learned this one the hard way a few months ago. We ran into a flexbox bug in one browser which we worked around by adding some-rule: 0.0000001px instead of 0px. However, our minifier collapsed that using scientific notation, which triggered a rendering issue in a different browser due to the out-of-spec CSS. The whole adventure left me feeling like I'd travelled back in time.

[1] https://www.w3.org/TR/CSS21/syndata.html#numbers

Re: What CSS minifiers also leave behind

#4
Author here.

Wow. #1 on HN. Wow.

I'd usually hang around a bit more, but I'm really tired. I posted this past my midnight. 00:51 now, and I'm fading fast.

Thanks for all the love, everyone. I'll come over tomorrow (12 hours from now, or so) to answer any questions or to pick up any corrections.

Re: What CSS minifiers also leave behind

#5
post #2

I'm for hire now. Le Sigh. Email's in the footer. Remy: I'd suggest posting a CV and linking to it from this post. I looked and couldn't find one anywhere on your site; you'll get a lot more qualified interest if people can find out more about you than just a few blog posts.

I thought about it, but I'm way too shy for that.

Not like it would lead to anywhere either, you know. :P

Two years of teaching university, MSc in computing, love of automation, combinatiorial optimization without any significant amount of deep math skill, circuit design, gate array stuff, low-level CPU optimization stuff, hardware counters, microcontrollers, SQLite, Julia language, C, shell, a bunch more programming languages, basic CSS and HTML, Mustache templates, Linux. No JavaScript. The whole of luisant.ca is done by hand and from scratch, so you can see what I can do with that. Also statistics.

I'm uncommonly silly and not at all serious, while still standing up for what I believe is right, even if everyone disagrees with me. I do integrity though and while I can stand my ground, I will yield to good evidence any day.

I wear goofy clothes to work, usually very colourful stuff. Don't expect conformity.

And I have no love greater than the one for the cause of nature conservation, and all research that goes with that.

That's about me in a nutshell.

Told you nothing will come of it. :P

Re: What CSS minifiers also leave behind

#6
crass is doing some really wonderful stuff here -- I'm impressed!

It's very interesting, however, that no one minifier is a consistent winner in these test cases, and that running CSS through multiple minifiers is actually, potentially, not all that crazy. (The very debatable real value in doing that notwithstanding.)

Re: What CSS minifiers also leave behind

#7
post #3

The scientific notation one is a bug. Scientific notation isn't part of the CSS spec[1], and its not supported in all browsers. I learned this one the hard way a few months ago. We ran into a flexbox bug in one browser which we worked around by adding some-rule: 0.0000001px instead of 0px. However, our minifier collapsed that using scientific notation, which triggered a rendering issue in a different browser due to t…

That's a hell of a bug, always an adventure when the error locality is really far.

Re: What CSS minifiers also leave behind

#8
This looks like a fun project indeed!

Unfortunately every time I read something about minifiers I got the feeling that people are optimizing the wrong problem.

If you gzip data over the line it's already compressed. So minifying your stuff will only help you a little.

The problem is on the client side. You can compress what you like but if the browser starts dropping frames because it has to compile/handle a ton of Javascript and CSS then minifying doesn't help the end user.

Re: What CSS minifiers also leave behind

#9
post #6

crass is doing some really wonderful stuff here -- I'm impressed! It's very interesting, however, that no one minifier is a consistent winner in these test cases, and that running CSS through multiple minifiers is actually, potentially, not all that crazy. (The very debatable real value in doing that notwithstanding.)

Yeah, crass is pretty amazing.

Have you seen my post on the Remynifier, where I do exactly that?

https://luisant.ca/remynifier

Re: What CSS minifiers also leave behind

#10
post #8

This looks like a fun project indeed! Unfortunately every time I read something about minifiers I got the feeling that people are optimizing the wrong problem. If you gzip data over the line it's already compressed. So minifying your stuff will only help you a little. The problem is on the client side. You can compress what you like but if the browser starts dropping frames because it has to compile/handle a ton of J…

I had an article about that too. If you have to do just one, you should go with zopfli or brotli instead of minifying. Having both minification and some kind of compression on top does help the file sizes.

https://luisant.ca/brotli-css

Also, purifycss and uncss are your friends to cut stuff down, to reduce the final load for the user.

Post reply on HN