Closed picov closed 2 years ago
We shouldn't minify 0px
as 0
in CSS variables. Unitless 0 as length won't work in calc() and other math functions. Source
Specification
Note: Because number-token
s are always interpreted as number
s or integer
s, "unitless 0" length
s aren’t supported in math functions. That is, width: calc(0 + 5px); is invalid, because it’s trying to add a number
to a length
, even though both width: 0; and width: 5px; are valid.
Demo
--column-gap: 0px;
width: calc(100% - var(--column-gap));
We have a fork of this and fixed it by removing the shortenZeroes
function in CSS.php
. We didn't find much value in removing a few zeroes at the cost of the complexity. A proper solution would need some more regexes.
Fixed in #392
:root{--uk-position-margin-offset:0px}
is minified as
:root{--uk-position-margin-offset:0}
and this cause bad CSS behaviour