color-no-invalid-hex
Disallow invalid hex colors.
a { color: #y3 }/** ↑ * This hex color */Use this rule to avoid declarations that browsers ignore. An invalid hex color, e.g. #ff, invalidates the whole declaration.
Longhand hex colors can be either 6 or 8 (with alpha channel) hexadecimal characters. And their shorthand variants are 3 and 4 characters respectively.
This rule supports 1 message argument: the invalid hex color.
Options
Section titled “Options”{ "color-no-invalid-hex": true}The following patterns are considered problems:
a { color: #00; }a { color: #fff1az; }a { color: #12345aa; }The following patterns are not considered problems:
a { color: #000; }a { color: #000f; }a { color: #fff1a0; }a { color: #123450aa; }