NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2100 most downloaded on npm
Minify colors in your CSS files with PostCSS.
Last release 2 days ago
02 Oct 2026
Release timing varies
gaps range from 8 days to 4 months
Most releases are documented
notes for 43 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
90 releases · first in 2015
Require Browserslist 4.29.3 or later.
fix(postcss-svgo): decode SVG following WHATWG specification in #1975
Full Changelog: https://github.com/cssnano/cssnano/compare/cssnano@9.0.4...cssnano@9.0.5
One column per quarter.
fix: update postcss-calc in #1970
Full Changelog: https://github.com/cssnano/cssnano/compare/cssnano@9.0.3...cssnano@9.0.4
Restricts color minification to CSS properties that accept <color> and custom properties, preserving custom identifiers in properties like animation-name, grid-area, and counter-reset. Adds support for hwb() color values and minification inside color-mix(), light-dark(), and var() fallbacks, while preserving relative color syntax, math functions, and token boundary separators.
perf: median 15% speed increase on test fixtures
Use ASCII case-insensitive matching for CSS names and grammar keywords so Unicode lookalikes are preserved, and restrict CSS whitespace normalization to the CSS whitespace set.
update browserslist
Updated dependencies:
fix: update color parsing library in #1964
fix: update color parsing library in #1964
fix: update PostCSS and selector parser
fix: update conflict detection and color conversion CSS spec conformance
fix: update PostCSS peer dependency
Full Changelog: https://github.com/cssnano/cssnano/compare/cssnano@9.0.2...cssnano@9.0.3
fix: updae browserslist, mdn-data, autoprefixer
fix: update calc and color minifiers, autoprefixer
fix: add main and types to package manifests in #1958
Full Changelog: https://github.com/cssnano/cssnano/compare/cssnano@9.0.1...cssnano@9.0.2
fix(postcss-colormin, postcss-minify-gradients): update color parsing library
fix: update postcss and selector parser
fix: update conflict detection and color conversion CSS spec conformance
fix: update PostCSS peer dependency
refactor: some small performance gains in #1955
Full Changelog: https://github.com/cssnano/cssnano/compare/cssnano@9.0.0...cssnano@9.0.1
Migrate to ESM and simplify config loading in #1948
Probably backward-compatible for most users. Some changes to configuration loading documented in migration guide.
Full Changelog: https://github.com/cssnano/cssnano/compare/cssnano@8.0.10...cssnano@9.0.0
^22.22.3 || ^24.15.0 || >=26.0. Package subpath imports are no longer supported. See the migration documentation before upgrading.fix(postcss-merge-longhand): fix issues with border merging in #1886
Full Changelog: https://github.com/cssnano/cssnano/compare/cssnano@8.0.4...cssnano@8.0.5
Fix postcs-svgo encoding in #1877
Full Changelog: https://github.com/cssnano/cssnano/compare/cssnano@8.0.3...cssnano@8.0.4
postcss-reduce-initial: update initial properties
packages now define an exports field in package.json. This prevents any file added to the package to automatically be exposed as a possible import. The has been done in a backward compatible way, so you should be able to import every file you did in the previous release.
types have also been regenerated with TypeScript 7.
Full Changelog: https://github.com/cssnano/cssnano/compare/cssnano@8.0.2...cssnano@8.0.3
chore: regenerate all type definitions with TypeScript 7
chore: regenerate all type definitions with TypeScript 7
fix: update svgo, autoprefixer and postcss
feat: make some packages runnable on the web without extra polyfills
fix: update PostCSS
chore: define package.json exports
chore: update dependencies
Update autoprefixer, browserslist, colordx and postcss
chore: update the postcss peer dependency
ea8e33a: chore: drop Node.js 20 support
ea8e33a: chore: drop Node.js 20 support
Node.js 20 has reached end of life.
d1780fd: fix: update @colordx/core
322ad33: fix: update postcss peer dependency
5cb8b09: fix: udpate browserslist
5f64972: Replace colord with @colordx/core as the underlying color manipulation library. colord has not been updated since August 2022; colordx is its
5f64972: Replace colord with @colordx/core as the underlying color manipulation library. colord has not been updated since August 2022; colordx is its actively maintained successor with a compatible API.
This fixes a lossiness bug in postcss-colormin (#1515): colors like rgba(221, 221, 221, 0.5) were previously converted to hsla(0,0%,87%,.5), which round-trips back to rgb(222, 222, 222) — a visibly different color at sharp image/UI boundaries. The new output is fully lossless and picks the shortest representation.
The root cause was that colord rounds color values to integers at parse time, so HSL conversions accumulate rounding error. colordx stores values as floats, preserving exact precision through conversions and producing correct output:
/* Input */
rgba(221, 221, 221, 0.5) → hsla(0,0%,86.7%,.5) /* shorter and lossless ✓ */
rgba(50%, 50%, 50%, 0.5) → hsla(0,0%,50%,.5) /* shorter and lossless ✓ */
Additional improvements:
oklch(), oklab(), and hwb() values that fall within the sRGB gamut are now correctly minified in postcss-colormin (previously passed through unchanged)oklch, oklab, hwb, lch) are now correctly recognised as valid gradient color stops in postcss-minify-gradientsc3e537a: fix: update postcss-selector-parser
72dd9c9: fix: update browserslist
906a785: fix: update browserslist
5672148: fix: update PostCSS peer dependency to version without vulnerabilities
dff5c42: chore: update browserslist and postcss-selector-parser
0c85fa9: fix: update Browserslist version
0d10597: chore: drop support for Node.js 14 and 16
feat: add preset and plugin options for browserslist
83d3268: chore: update autoprefixer and browerslist
26bbbd3: chore: update minimum browserslist version to 4.22.2
18331a6: fix: update cssnano peer dependency to 8.4.31 to avoid security issue
ca9d3f55: Switch minimum supported Node version to 14 for all packages
fix(postcss-colormin): don't minify colors in src declarations
feature: add TypeScript type declarations
Publish untranspiled CommonJS source
refactor: remove implicit boolean conversion
### Patch Changes - refactor: use Map as a cache
fix(postcss-colormin): accept configuration options
Note: Version bump only for package postcss-colormin
Note: Version bump only for package postcss-colormin
Note: Version bump only for package postcss-colormin
postcss version is 8.2.1Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
postcss-merge-longhand incorrect minification of border (border-*) declarations.
postcss-merge-longhand incorrect minification of border (border-*) declarations.postcss-merge-longhand don't explode declarations with custom properties.
postcss-merge-longhand don't explode declarations with custom properties.postcss-colormin now better transform to hsl.browserslist version incompatibility with caniuse-api
browserslist version incompatibility with caniuse-apiWe dropped support for Node 4, now requiring at least Node 6.9.
border-spacing property.U to lowercase for IE <= 11 and Edge <= 15.a { border-style:dotted; border-style:var(--variable) }) correctly.border property with invalid border width value correctly.:-ms-input-placeholder and ::-ms-input-placeholder selectors correctly.all property correctly.url function.data and *-extension:// URLs correctly.all for IE.Includes the new release candidate for postcss-selector-parser 3.
@media \0screen\,screen\9 {} hacks
(thanks to @evilebottnawi).resolveConfig for a Root node without a source property
(thanks to @darthmaim).Since version 4 has been in-development for some time, we thought it would be best to release an alpha version so that we could catch any issues befor
Since version 4 has been in-development for some time, we thought it would be best to release an alpha version so that we could catch any issues before the actual release.
cssnano & its plugins have been upgraded to PostCSS 6.x. Please ensure that for optimal results that you use cssnano with a PostCSS 6 compatible runner & that any other plugins are also using PostCSS 6.
cssnano is now essentially a preset loader and does not contain any built-in
transforms (instead, it delegates to cssnano-preset-default by default).
Due to the new architecture, it's not possible to exclude asynchronous
transforms and run it synchronously, unlike in 3.x. Any transforms that
were "core" modules have now been extracted out into separate packages.
Because of the new preset system, cssnano will not accept any transformation options; these must be set in the preset. The option names remain mostly the same, except some cases where "core" modules have been extracted out:
core is now normalizeWhitespace.reduceBackgroundRepeat is now normalizeRepeatStyle.reduceDisplayValues is now normalizeDisplayValues.reducePositions is now normalizePositions.reduceTimingFunctions is now normalizeTimingFunctions.styleCache is now rawCache.When excluding transforms, we now have an exclude option (in 3.x this was
named disable). Similarly, the safe option was removed; the defaults
are now much less aggressive.
By default, the following transforms are no longer applied to any input CSS. You may see an increased output file size as a result:
autoprefixerpostcss-discard-unusedpostcss-merge-identspostcss-reduce-identspostcss-zindexNote that you can load cssnano-preset-advanced instead which does contain
these transforms.
We no longer detect previous plugins to silently exclude our own, and now
consider this to be an anti-pattern. So postcss-filter-plugins was removed.
We also changed some options to make the default transforms safer:
postcss-minify-font-values: removeAfterKeyword set to false from true.postcss-normalize-url: stripWWW set to false from true.cssnano now does not accept the sourcemap shortcut option; please refer
to the PostCSS documentation on sourcemaps. The quickstart.js file included
with this module will give you a good starting point.
cssnano.process is no longer a custom method; we use the built-in process
method exposed on each PostCSS plugin. The new signature is
cssnano.process(css, postcssOpts, cssnanoOpts), in 3.x it was
cssnano.process(css, cssnanoOpts).
We dropped support for Node 0.12, now requiring at least Node 4.
Finally, cssnano is now developed as a monorepo, due to the fact that some
transforms have a lot of grey area/overlap. Due to this, some modules have
been refactored to delegate responsibility to others, such that duplication
of functionality is minimized. For instance, postcss-colormin will no
longer compress whitespace or compress numbers, as those are handled by
postcss-normalize-whitespace & postcss-convert-values respectively.
clone behaviour. In cases where some utility
has been used by several plugins it is now a separate package, reducing
cssnano's footprint.postcss-colormin &
postcss-reduce-initial were enhanced with different behaviour depending
on which browsers are passed. And now, the footprint for the caniuse-db
dependency is much smaller thanks to caniuse-lite - 7 times smaller as
of this writing. This makes cssnano much faster to download from npm!Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →