NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2040 most downloaded on npm
PostCSS plugin to reduce calc()
Last release 3 days ago
01 Oct 2026
Ships unpredictably
gaps range from 1 weeks to 1.5 years
Nearly every release is documented
notes for 47 of 47 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
51 releases · first in 2014
transform a division or unit conversion only when the result is exact at the configured precision . For example., calc(100% / 3) stays calc(100% / 3)
precision. For example., calc(100% / 3) stays calc(100% / 3) instead ofcalc(33.33333%), and calc(1cm + 1px)1.02646cm.precision: false to transform every division.precision significant digits for values below 1, socalc(1px / 150000) is no longer rounded to .00001pxmin(), max() and clamp() preserve the original unitvar(), env(), attr() and--a: 1px + 2px, var(--a) * 2 means1px + 2px * 2, so reordering the multiplication would be a bug.var(--a) * 2 is not rewritten to 2 * var(--a), var(--a) / var(--a) is1px - (2 * var(--a))).anchor-size() are treated the same way, so2 * anchor-size(width) * .5, is no longer transformed to anchor-size(width)calc() that contains unresolved values, socalc(var(--a) - calc(var(--b) - var(--c))) is no longer rewritten tocalc(var(--a) - var(--b) + var(--c))calc((var(--b) - 7 - 2)) is now calc(-9 + var(--b)) instead ofcalc(-1 * (9 - var(--b))), which changed the value when --b expands toFull Changelog: v11.2.1...v11.2.2
One column per quarter.
do not emit invalid minus unary operator (the browser discards values like calc(-(-12px))
Full Changelog: v11.2.0...v11.2.1
The published unwrapSingleNegativeNumber option remains available as a deprecated alias for unwrapSingleValue .
calc() function when it wraps a single value, use unwrapSingleValue: true. This allows you to get rid of calc() and replace it with a single number wherever that is possible.sign() function was not computed correctlyThe published unwrapSingleNegativeNumber option remains available as a
deprecated alias for unwrapSingleValue.
Full Changelog: v11.1.2...v11.2.0
fix: preserve escaped and otherwise unusual identifiers in #316
Full Changelog: v11.1.1...v11.1.2
fix: preserve calc() in declarations when result is negative in #310
Full Changelog: v11.1.0...v11.1.1
feat: add reduceCalc for usage without PostCSS by @phuoccss in #304
Full Changelog: v11.0.3...v11.1.0
Improve performance by reducing the number of parsing and serialization steps
Full Changelog: v11.0.2...v11.0.3
Improve performance when processing calculations with many additions or multiplications.
Full Changelog: v11.0.1...v11.0.2
Omit leading zeroes when serializing finite fractional numbers, such as 0.5 as .5 .
0.5 as .5.Full Changelog: v11.0.0...v11.0.1
Require Node.js ^22.22.3, ^24.15, or >=26.0.
Require Node.js ^22.22.3, ^24.15, or >=26.0.
Publish an ESM package with an explicit exports entry point. CommonJS require('postcss-calc') remains
supported on the supported Node.js versions.
Remove the preserve option. Transformations now always update declarations, enabled media-query
parameters, and enabled selectors in place.
Rewrite the calculation engine around a CSS-aware tokenizer, Pratt parser, canonical AST, simplifier,
and serializer.
Add simplification support for modern CSS math functions, including abs(), sign(), mod(), rem(),
round(), trigonometric functions, pow(), sqrt(), hypot(), log(), and exp().
Improve public TypeScript declarations, including the exported PostCssCalcOptions type.
Preserve correct grouping when simplifying subtractions involving custom properties and other opaque
expressions.
Improve numerical precision and rounding, including signed-zero and exact-multiple mod()/rem()
behavior.
Fix handling of identifier-like negative tokens and selector calculations.
Maintain left-to-right evaluation order when folding product terms.
chore: ignore type formatting for now
chore: ignore type formatting for now
Nothing published for this version
Requires Node.js 22.12 for the ability to require() ESM modules
Requires Node.js 22.12 for the ability to require() ESM modules
The parser has been entirely rewritten (thanks @dkryaklin ) so most of the issues where the parser would error out with more complicated calc() expressions should be fixed.
chore(release): 10.2.0-rc.0
chore(release): 10.2.0-rc.0
fix: handle calc keywords correctly by @ludofischer in https://github.com/postcss/postcss-calc/pull/234
Full Changelog: https://github.com/postcss/postcss-calc/compare/v10.1.0...v10.1.1
Full Changelog: v10.1.0...v10.1.1
Ignore calc-size from detection
fix: add support for svh, lvh, dvh, svw, lvw, dvw, svmin, lvmin, dvmin, svmax, lvmax, dvmax units by @geecko86 in #218
Drop support for Node.js 14, 16, 19 and 21. The release is otherwise identical to the previous one.
Drop support for Node.js 14, 16, 19 and 21. The release is otherwise identical to the previous one.
fix disappearing calc() expression when source contains extra brackets
calc() expression when source contains extra brackets (18bb47bd0)This release should be functionally identical to the previous (8.2.4) release, except that it officially drops compatibility with Node older than Node
This release should be functionally identical to the previous (8.2.4) release, except that it officially drops compatibility with Node older than Node 14.
convert source to CommonJS and publish untranspiled code
## Bug Fixes * improve types
## Bug Fixes * respect CSS var when reducing
preserve brackets around functions (0b70a1d), closes #113 #115
## Features * add types
## Features - avoid fatal error
Breaking: Updated PostCSS from v7.x to v8.x
- Fixed: reduction
Fixed: strips away important factors from multiplications in calc()
Fixed: substracted css-variable from zero
Fixed: incorrect reduction of subtraction from zero
calc with single var (cssnano/cssnano#725)postcss to 7.0.27 (patch)postcss-selector-parser to 6.0.2postcss-value-parser to 4.0.2Updated: postcss to 7.0.2 (patch)
postcss to 7.0.2 (patch)postcss-selector-parser to 5.0.0-rc.4 (patch)postcss-value-parser to 3.3.1 (patch)Changed: Updated postcss-selector-parser to version 5.0.0-rc.3
* and / (cssnano#625)100% incorrectly being transformed to 1 (reduce-css-calc#44)Fixed: use PostCSS 7 (thanks to @douglasduteil)
Fixed: throwing error for attribute selectors without a value
Breaking: Updated PostCSS from v5.x to v6.x, and reduce-css-calc from v1.x to v2.x (thanks to @andyjansson).
Fixed: avoid security issue related to reduce-css-calc@< 1.2.4.
reduce-css-calc@< 1.2.4.Added: support for selector transformation via selectors option. (#29 - @uniquegestaltung)
selectors option.
(#29 - @uniquegestaltung)Fixed: support for multiline value
Added: "mediaQueries" option for @media support
@media support
(#22)Added: "warnWhenCannotResolve" option to warn when calc() are not reduced to a single value
Removed: compatibility with postcss v4.x
Added: compatibility with postcss v4.1.x
Fixed: preserve option does not create duplicated values
preserve option does not create duplicated values (#7)Added: compatibility with postcss v4.x
- Added: GNU like exceptions (#4) - Added: precision option (#5) - Added: preserve option
Added: source of the error (gnu like message) (fix #3)
Fixed: correctly ignore unrecognized values (fix #2)
Changed: Plugin now return a function to have a consistent api. (ref 1, ref 2)
✨ First release based on rework-calc v1.1.0 (code mainly exported to `reduce-css-calc`)
✨ First release based on rework-calc v1.1.0 (code mainly exported to reduce-css-calc)
Your coding agent can read these notes before it upgrades. Set up the MCP server →