Skip to main content

color-hex-alpha

Require or disallow alpha channel for hex colors.

a { color: #fffa }
/** ↑
* This alpha channel */

The message secondary option can accept the arguments of this rule.

Options

"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"

{
"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; }