Fix length-zero-no-unit
false positives for custom properties
#274
Labels
status: ask to implement
ask before implementing as may no longer be relevant
type: bug
a problem with a feature or rule
What steps are needed to reproduce the bug?
Hi everyone,
CSS code:
stylelintrc config:
Error:
Where
left: calc(var(--offset) + 50%);
with--offset: 0
(without unit) results to invalidleft: calc(0 + 50%);
css.(mini repo to reproduce: https://github.com/mbehzad/reproduce-length-zero-no-unit-custom-properties-issue)
I think it is more safe to have the rule as
If this makes sense, I can open a PR.
Cheers
What did you expect to happen?
Not removing the unit for this case: (
--offset: 0px;
)What actually happened?
--offset: 0px;
needs to be changed to--offset: 0;
The text was updated successfully, but these errors were encountered: