color-hex-alpha
Require or disallow alpha channel for hex colors.
a { color: #fffa }/** ↑ * This alpha channel */Use this rule to enforce a convention. A hex color can carry its alpha as a fourth pair of digits, e.g. #00000080. Choose one for consistency.
This rule supports 1 message argument: the hex color.
Options
Section titled “Options”"always"
Section titled “"always"”{ "color-hex-alpha": "always"}The following patterns are considered problems:
a { color: #fff; }a { color: #ffffff; }The following patterns are not considered problems:
a { color: #fffa; }a { color: #ffffffaa; }"never"
Section titled “"never"”{ "color-hex-alpha": "never"}The following patterns are considered problems:
a { color: #fffa; }a { color: #ffffffaa; }The following patterns are not considered problems:
a { color: #fff; }a { color: #ffffff; }