FirefoxBar / xStyle

A user styles manager for Firefox and Chrome
http://team.firefoxcn.net/#addons
GNU General Public License v3.0
171 stars 13 forks source link

Math preprocessing bug #56

Closed PalmtopTiger closed 6 years ago

PalmtopTiger commented 6 years ago

height: calc(100vh - 43px); turns into height: calc(57vh); what is not the same.

sylingd commented 6 years ago

You can use calc(~"100vh - 43px") to solute this problem now. I will confirm which component caused the problem later

sylingd commented 6 years ago

I have found a issue related to this problem: https://github.com/less/less.js/issues/1366 In short, calc is a keyword of less, less will calculate it. But many values can not be calculated, for example, 100% - 10px, 100vh + 3px, but less aslo will try to calculate it. So, if you do not want less compiler calculate it: If you do not use less variables in calc, use calc(~"100% - 40px") If you want to use less variables in calc, use calc(~"100% - @{foo}")

sylingd commented 6 years ago

I will enable "Strict Math" option next version

PalmtopTiger commented 6 years ago

Thank you.