postcss / postcss-calc

PostCSS plugin to reduce calc()
MIT License
212 stars 34 forks source link

fix: repect CSS var when reducing #162

Closed ludofischer closed 2 years ago

ludofischer commented 2 years ago

fix: respect CSS var when reducing

Fix https://github.com/cssnano/cssnano/issues/1235

Preserve the parentheses around a math expression that contains a var() function call, to guarantee that the expression value stays the same.

The CSS custom properties might contain an addition or subtraction, so even distributing multiplication or division is not safe.