Fix false positives for hex colours in unit-whitelist #4493
Labels
status: ready to implement
is ready to be worked on by someone
syntax: sass
relates to Sass and Sass-like syntax
type: bug
a problem with a feature or rule
unit-whitelist doesn't properly parse hex colors, starting with number in border property.
If hex color contains any letter except for "E" in border property, it causes error.
e.g.
border: 2px solid #2196F3
If we move color to the first place of border property (border: #2196F3 2px solid) or extract it to border-color property or change it to rgb(33, 150, 243), error dissappears.
Single "E" in hex color dont't cause error because it is still a number - 2196E3 = 2196*10^3. "E" on last place or second "E" throws error too - it is not a proper number now.
unit-whitelist
12.0.1
VS Code and stylelint extension
"I use SASS syntax without braces"
"No errors to be flagged."
"The following warnings were flagged:"
filter.module.sass Unexpected unit "F3" (unit-whitelist) stylelint(unit-whitelist) [54, 25]
The text was updated successfully, but these errors were encountered: