Skip to content

Files

Latest commit

 

History

History
51 lines (35 loc) · 743 Bytes

color-no-invalid-hex.md

File metadata and controls

51 lines (35 loc) · 743 Bytes

Pattern: Invalid hex color

Issue: -

Description

Longhand hex colors can be either 6 or 8 (with alpha channel) hexadecimal characters. And their shorthand variants are 3 and 4 characters respectively.

Examples

The following patterns are considered violations:

a { color: #y3 }
/**        ↑
 * These hex colors */
a { color: #00; }
a { color: #fff1az; }
a { color: #12345aa; }

The following patterns are not considered violations:

a { color: #000; }
a { color: #000f; }
a { color: #fff1a0; }
a { color: #123450aa; }

Further Reading