Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not remove length unit for zero-values in min(), max() and clamp() #426

Closed
davidmondok opened this issue Nov 26, 2020 · 1 comment
Closed

Comments

@davidmondok
Copy link

CSSO should not remove px length unit for zero-values in min(), max() and clamp() CSS functions.

The following minifies the 0px value to 0, which causes an invalid property value error in all the browsers I tested (Chrome, Firefox and Safari):

margin-left: max(0px, (100% - 10rem)); // works

margin-left: max(0, (100% - 10rem)); // invalid property value

As a workaround one can simply write 0% instead of 0px, which won't get minified to 0.

@lahmatiy
Copy link
Member

Looks like it's easy to fix, we need check against a list of functions here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants