cssnano /cssnano
A modular CSS minifier, built on top of the PostCSS ecosystem.
★ 4,980⑂ 331👁 45⑃ 1,278● 774▤ 166
+0
Daily
4,980
stars
331
forks
45
watchers
1,278
prs
774
issues
166
releases
README
A modular CSS minifier, built on top of the PostCSS ecosystem. cssnano is a modern, modular CSS compression tool written on top of the PostCSS ecosystem, which allows us to use a lot of powerful features in order to minify CSS. Our preset system allows you to load cssnano in a different configuration depending on your needs; the default preset performs safe transforms, whereas the advanced preset performs more aggressive transforms that are safe only when your site meets the requirements; but regardless of the preset you choose, we handle more than whitespace transforms! Optimisations range from compressing colours & removing comments, to discarding overridden at-rules, normalising unicode-range descriptors, even mangling gradient parameters for a smaller output value! In addition, where it's made sense for a transform, we've added Browserslist to provide different output depending on the browsers that you support. For further details check out the website: - Installation guide for your build process. - Full list of optimisations. You can now try cssnano online! Semantic Versioning Policy The guiding principle is that a page should render the same with the minified CSS as with the original CSS. So cssnano should not break a working stylesheet, and should also not fix a broken stylesheet, because it makes it harder for developers to debug the application. This matters especially when the stylesheet is only minified for the production build. Major releases A major release indicates that cssnano requires a different runtime or configuration to keep working, or when its output is likely to be parsed incorrectly by browsers that were previously supported. This includes changes to the supported Node.js versions and incompatible configuration changes. Minor releases This is for releases that might introduce changes to the stylesheet where there were none previously. This includes introducing a new minification, for example merging, which can restructure the output, or removing a transformation. These changes should not alter browser support for the CSS that cssnano outputs. Patch releases These are bug fixes in existing minifications, or internal changes like refactorings or dependency changes. Contributing See CONTRIBUTING.md. Contributors This project exists thanks to all the people who contribute. [Contribute]. Backers Thank you to all our backers! 🙏 [Become a backer] Sponsors Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor] License MIT © Ben Briggs
Top issues
#111pack same CSS media query rules into one media query rule35 comments · 2016-01-27#833Looking for new owner(s)/maintainer(s)18 comments · 2019-11-07#1004[Bug] : CSSNano has problems with postcss-nested16 comments · 2021-02-26#832Can't disable rawCache optimisation7 comments · 2019-11-02#323First of Type7 comments · 2016-12-16#197Discussion: transformation to lowercase?7 comments · 2016-05-20#598Could cssnano merge background properties?4 comments · 2018-09-09#1487[Feature Request]: Convert CSS rules to nested CSS rules3 comments · 2023-03-29
Discussions
#2037Proposal: remove postcss-svgo from the default preset0 comments · 2026-10-09#1742mergeLongHand for animation ranges?0 comments · 2026-01-31#1728calc(x*1) and calc(x*0)3 comments · 2025-10-03#1566Removing CSS size1 comments · 2024-02-24#1517Automatically make CSS atomic1 comments · 2023-08-12#1516Is there a way to expand CSS variables?3 comments · 2023-08-10#1462cssnano dependency error1 comments · 2023-01-10#1441cssnano version 60 comments · 2022-10-24
Latest release
v9.9.0 [email protected] 2026-10-16What's Changed - cssnano now ships its presets and plugins in a single package, so installing it adds one cssnano package to your dependency tree instead of about thirty, and you have fewer packages to review in audits and lockfile updates. preset: 'lite' and preset: 'advanced' now work without installing another package. An installed preset package still takes precedence over the built-in one and prints a one-time CSSNANO_INSTALLED_PRESET warning; pass the imported preset function to keep it without the warning. Full names such as cssnano-preset-default fall back to the built-in prese