-
-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Labels
Description
Rule details
Disallow invalid hex colors.
What type of rule is this?
Warns about a potential problem
Example code
/* Not OK */
a { color: #00; }
a { color: #fff1az; }
a { color: #12345aa; }
/* OK */
a { color: #000; }
a { color: #000f; }
a { color: #fff1a0; }
a { color: #123450aa; }
Prior Art
stylelint: https://stylelint.io/user-guide/rules/color-no-invalid-hex
Participation
- I am willing to submit a pull request to implement this rule.
Additional comments
Longhand hex colors can be either 6 or 8 (with alpha channel) hexadecimal characters. And their shorthand variants are 3 and 4 characters respectively.
So, if a hex color does not follow these formats, it won't be recognized as a valid hex color.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Triaging