# noHexColors

Rule `biome/noHexColors`. Disallow hex colors.

- Source: biome
- Technologies: CSS
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1909 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `style/noHexColors` | no | no | group style, since 2.3.14 | [docs](https://biomejs.dev/linter/rules/no-hex-colors/) |

## Code examples

### Incorrect: the rule reports this

```css
a { color: #000; }
```

```css
a { color: #fff1aa; }
```

```css
a { color: #123456aa; }
```

### Correct: the rule accepts this

```css
a { color: black; }
```

```css
a { color: rgb(0, 0, 0); }
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "style": {
        "noHexColors": "error"
      }
    }
  }
}
```

## Related rules

- [biome/noExcessiveSelectorComplexity](https://lintradar.dev/rules/biome/noExcessiveSelectorComplexity.md): Limit how complex selectors can be, and disallow chosen parts of selectors.
- [biome/noInlineStyles](https://lintradar.dev/rules/biome/noInlineStyles.md): Disallow the use of inline styles.
- [biome/noExcessiveSelectorClasses](https://lintradar.dev/rules/biome/noExcessiveSelectorClasses.md): Limit the number of classes in a selector.
- [biome/noJsxLeakedDollar](https://lintradar.dev/rules/biome/noJsxLeakedDollar.md): Flags text nodes with a trailing `$` before a JSX expression.
- [biome/noDrizzleDbObjectInsideTransaction](https://lintradar.dev/rules/biome/noDrizzleDbObjectInsideTransaction.md): Disallow using a Drizzle ORM instance inside its own transaction callback.
- [biome/noMisleadingReturnType](https://lintradar.dev/rules/biome/noMisleadingReturnType.md): Detect return type annotations that are misleadingly wider than what the implementation actually returns.

---

Web page: https://lintradar.dev/rules/biome/noHexColors. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
