PropertyUnits should report warnings when units are missing
Right now, scss-lint is totally fine with
.foo {
padding: 30;
}
Can we please reject that?
Hey @ptarjan, that CSS looks perfectly valid to me from a syntactical perspective. If you are referring to the lack of units on padding, this kind of checking can get complicated since it's hard for scss-lint to know all the situations where specifying units would make sense (especially when you need to also work around interpolation).
There might be a solution where we can get the PropertyUnits linter to report a warning when no units are provided for certain properties. I'd be open to a pull request adding that functionality, otherwise I'll get to it when I can.
Yes that's exactly what I meant, the missing units.
Does PropertyUnits not already have this functionality? I'm looking at the
border: ['px'] # Only pixels
line here
An nice. Then I'm proposing that by default all the allowed CSS units should be in there.
@ptarjan is there a documented list of CSS properties and their allowed units you could point to? That would make implementing this request pretty trivial.
Sadly I don't, I'd be Googling for it like you would. Can you start small with the obvious ones and then grow it as we notice problems? I'd start with padding (and all the 4 -top, -right variants), margin (and variants) font-size, height, and width.