postcss / postcss-calc

PostCSS plugin to reduce calc()
MIT License
215 stars 33 forks source link

Insert more needed parenthesis #116

Closed mischnic closed 2 years ago

mischnic commented 4 years ago

Closes https://github.com/postcss/postcss-calc/issues/115

One thing that might be causing old tests to fail is that calc (and the postcss-calc parser) is probably left-associative by default, so no parentheses are needed in cases like (a - b) - c.

basher commented 3 years ago

Any updates on this PR?

dangelion commented 3 years ago

Any news? This bug is seriously blocking! 😰

dangelion commented 3 years ago

Maybe someone could check this library to be inspired https://github.com/nico-jacobs/postcss-remove-nested-calc It works, just tried

ludofischer commented 2 years ago

I don't think approach is going to work, because it adds round brackets where there aren't any in the source, which can change the meaning, and it also add brackets around values which do not contain any variables and so could be simplified.