You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In version 2.11.0 of postcss-cssnext, complex calc functions would not be simplified, so they would remain as is when compiled. However, I upgraded postcss-cssnext and in version 3.1.0, postcss-cssnext tries to simplify the calc function, but does so incorrectly. Maybe I'm doing something wrong on my end, but upgrading from 2.11.0 to 3.1.0 seems to mess up the result. For example:
This was reported in postcss-cssnext, but it was recommended to be reported here. The post below is nearly identical to the link below:
MoOx/postcss-cssnext#450
In version 2.11.0 of
postcss-cssnext
, complex calc functions would not be simplified, so they would remain as is when compiled. However, I upgradedpostcss-cssnext
and in version 3.1.0,postcss-cssnext
tries to simplify the calc function, but does so incorrectly. Maybe I'm doing something wrong on my end, but upgrading from 2.11.0 to 3.1.0 seems to mess up the result. For example:calc(100% + (2 * 100px) - ((75.37% - 63.5px) - 900px));
incorrectly simplifies and compiles to:
calc(100% + 200px - 75.37% - 963.5px));
The double negative here is not handled properly.
Also, the following:
calc(((((100% + (2 * 30px) + 63.5px) / 0.7537) - (100vw - 60px)) / 2) + 30px);
incorrectly simplifies and compiles to:
calc((176.0366% + 217.4052px - 100vw - 60px) / 2 + 30px);
I have no idea what is happening here, but it's completely wrong.
I know I could simplify my calcs, but there are some semantics behind organizing it this way in my code.
In version 2.11.0, when the compiled calcs were sent to the browser without being simplified, they worked as expected.
The text was updated successfully, but these errors were encountered: