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
Version 2.0.0 included a breaking change that makes sense but has an error. That change was:
reduce-css-calc will now throw when trying to multiply or divide by the same unit (e.g. calc(200px * 20px)), and also when trying to divide by zero.
While a unit like "px" times "px" should throw an error, a percent ("%") is not a unit; it denotes a fraction of 100. It is legitimate to multiple 50% by 50%, as it is the exact same mathematical meaning as 50/100 * 50/100.
I may be wrong here, but I'm pretty sure. Thoughts?
The text was updated successfully, but these errors were encountered:
Well shoot. Maybe it isn't that simple ... Because this is CSS math; not "standard" math.
I'm having a hard time thinking of an example where it would be unsafe to treat a percent as traditional math and drop it as a "unit" if there is another unit within a formula. But perhaps it is not as clear cut as I first thought.
I am going to close this issue for now since I am now less certain a change should be made.
Version 2.0.0 included a breaking change that makes sense but has an error. That change was:
While a unit like "px" times "px" should throw an error, a percent ("%") is not a unit; it denotes a fraction of 100. It is legitimate to multiple 50% by 50%, as it is the exact same mathematical meaning as
50/100 * 50/100
.I may be wrong here, but I'm pretty sure. Thoughts?
The text was updated successfully, but these errors were encountered: