Closed hawckins closed 1 year ago
How it is related to postcss-calc?
Also length-zero-no-unit
is ignored calc in new version of stylelint, because it was bug, please update stylelint
From my understanding, unitless zero lengths inside calc()
are not valid as 0 cannot be treated as a valid <length>
and the expected behavior of calc(10px * 0)
should evaluate to 0px
. In terms of parsers, someone could write parsing logic to force a unitless zero length to be spit out e.g. 0 instead of 0px but most browsers will consider calc(0)
invalid so I don't think that's a very good idea just to avoid a stylelint rule.
I take it that this was never a cssnano issue but rather a mistaken rule in an (old) stylelint release, so we can close it.
We have a stylelint "length-zero-no-unit":true enabled so 0 values should not have units associated to it. But calc is returning 0 with units for example calc(2px * 0); is returning as 0px but if zero we need just 0 not 0px. Is there any option which I can enable to get this?