color-no-hex
What it does
Section titled “What it does”Reports a hex color (#fff).
Why it matters
Section titled “Why it matters”Some projects use named colors or functions only, so a color can be told by its name or channels, not by a code that has to be decoded. The rule is a policy for those; it is off by default.
To fix, write the color as a name or with rgb(), hsl() or another function.
Example
Section titled “Example”... width: calc(0px + 1px);... color: #aabbcc; color: #abc; border-color: #ab #abcde #abcdef;...Configuration
Section titled “Configuration”css: lint: rules: color-no-hex: warn # off (default), warn, errorless: lint: rules: color-no-hex: warn # off (default), warn, errorscss: lint: rules: color-no-hex: warn # off (default), warn, errorSuppress one line with sudsy-disable-next-line color-no-hex in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| stylelint | color-no-hex |
full |