# noExcessiveSelectorComplexity

Rule `biome/noExcessiveSelectorComplexity`. Limit how complex selectors can be, and disallow chosen parts of selectors.

- 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: #1908 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/noExcessiveSelectorComplexity` | no | no | group nursery, since 2.6.7 | [docs](https://biomejs.dev/linter/rules/no-excessive-selector-complexity/) |

## Code examples

### Incorrect: the rule reports this

```css
#main #sidebar {}
```

```css
button:hover {}
```

### Correct: the rule accepts this

```css
#main .sidebar,
#footer {}

#main:not(#sidebar) {}

button:focus {}
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noExcessiveSelectorComplexity": "error"
      }
    }
  }
}
```

## Related rules

- [biome/noExcessiveSelectorClasses](https://lintradar.dev/rules/biome/noExcessiveSelectorClasses.md): Limit the number of classes in a selector.
- [biome/noHexColors](https://lintradar.dev/rules/biome/noHexColors.md): Disallow hex colors.
- [biome/noDrizzleDbObjectInsideTransaction](https://lintradar.dev/rules/biome/noDrizzleDbObjectInsideTransaction.md): Disallow using a Drizzle ORM instance inside its own transaction callback.
- [biome/noInlineStyles](https://lintradar.dev/rules/biome/noInlineStyles.md): Disallow the use of inline styles.
- [biome/noDisabledAttribute](https://lintradar.dev/rules/biome/noDisabledAttribute.md): Discourages the `disabled` attribute on form controls and on elements that act as buttons.
- [biome/noJsxLeakedDollar](https://lintradar.dev/rules/biome/noJsxLeakedDollar.md): Flags text nodes with a trailing `$` before a JSX expression.

---

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