Introduction
In 2025 I started contributing to cssnano, the CSS minifier that runs at the end of a lot of build pipelines. If you use PostCSS, there's a good chance it processes your CSS on every production build. I came for a couple of correctness bugs, and then I stayed for performance.
cssnano is an old project. The core plugins carry about ten years of edge cases, and most of that code was written to be correct, not fast. For a minifier that's the right priority. But it also means there's room to make it faster without taking risks.
I had one rule for the whole effort: the output must not change. A minifier that produces different bytes after an "optimization" isn't optimized, it's broken. So every change had to keep all fixtures green and produce the exact same CSS, just in less time.
Results first







