Closed csr632 closed 3 years ago
Two test cases can be added:
test(
'should reduce substracted expression from zero (css-variable)',
testValue,
'calc( 0px - (var(--foo, 4px) / 2))',
'calc( 0px - (var(--foo, 4px) / 2))',
);
test(
'should reduce substracted expression from zero (unknown unit)',
testValue,
'calc( 0px - (4unknown / 2))',
'calc( 0px - (4unknown / 2))',
);
You can see the error when you add these test cases to tests
While https://github.com/postcss/postcss-calc/issues/88 is fixed by https://github.com/postcss/postcss-calc/pull/93 , this case still has bug:
calc(0px - (var(--foo, 4px) / 2))
is reduced into:calc(var(--foo, 4px)/2)