mirror of
https://github.com/thangisme/notes.git
synced 2024-06-11 02:00:41 +00:00
52 lines
578 B
Markdown
52 lines
578 B
Markdown
|
# color-no-hex
|
||
|
|
||
|
Disallow hex colors.
|
||
|
|
||
|
```css
|
||
|
a { color: #333 }
|
||
|
/** ↑
|
||
|
* These hex colors */
|
||
|
```
|
||
|
|
||
|
## Options
|
||
|
|
||
|
### `true`
|
||
|
|
||
|
The following patterns are considered warnings:
|
||
|
|
||
|
```css
|
||
|
a { color: #000; }
|
||
|
```
|
||
|
|
||
|
```css
|
||
|
a { color: #fff1aa; }
|
||
|
```
|
||
|
|
||
|
```css
|
||
|
a { color: #123456aa; }
|
||
|
```
|
||
|
|
||
|
Hex values that are not valid also cause warnings:
|
||
|
|
||
|
```css
|
||
|
a { color: #foobar; }
|
||
|
```
|
||
|
|
||
|
```css
|
||
|
a { color: #0000000000000000; }
|
||
|
```
|
||
|
|
||
|
The following patterns are *not* considered warnings:
|
||
|
|
||
|
```css
|
||
|
a { color: black; }
|
||
|
```
|
||
|
|
||
|
```css
|
||
|
a { color: rgb(0, 0, 0); }
|
||
|
```
|
||
|
|
||
|
```css
|
||
|
a { color: rgba(0, 0, 0, 1); }
|
||
|
```
|