color-hex-length
Specify short or long notation for hex colors.
a { color: #fff }/** ↑ * This hex color */Use this rule to enforce a convention. A hex color can be shortened when each pair of digits repeats, e.g. #fff for #ffffff.
Choose:
"short"for brevity"long"to match colors copied from design tools
The fix option can automatically fix all of the problems reported by this rule.
This rule supports 2 message arguments: the hex color and its expected notation.
Options
Section titled “Options”"short"
Section titled “"short"”{ "color-hex-length": "short"}The following patterns are considered problems:
a { color: #ffffff; }a { color: #ffffffaa; }The following patterns are not considered problems:
a { color: #fff; }a { color: #fffa; }a { color: #a4a4a4; }"long"
Section titled “"long"”{ "color-hex-length": "long"}The following patterns are considered problems:
a { color: #fff; }a { color: #fffa; }The following patterns are not considered problems:
a { color: #ffffff; }a { color: #ffffffaa; }