If you add an extra pair of parentheses around the argument to the calc function, postcss-calc removes the calc token.
For example:
calc((var(--circumference) / var(--number-of-segments)))
turns into
(var(--circumference) / var(--number-of-segments))
Expected behaviour
calc should stay and the extra parentheses disappear:
calc((var(--circumference) / var(--number-of-segments)))
turns into
calc(var(--circumference) / var(--number-of-segments))
Describe the bug
If you add an extra pair of parentheses around the argument to the
calc
function,postcss-calc
removes thecalc
token. For example:calc((var(--circumference) / var(--number-of-segments)))
turns into(var(--circumference) / var(--number-of-segments))
Expected behaviour
calc
should stay and the extra parentheses disappear:calc((var(--circumference) / var(--number-of-segments)))
turns intocalc(var(--circumference) / var(--number-of-segments))
Steps to reproduce
See https://github.com/postcss/postcss-calc/pull/180
Version
8.2.4
Environment
Package details
Additional context
Originally submitted on the cssnano repository: https://github.com/cssnano/cssnano/issues/1490