Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 924 Bytes

File metadata and controls

48 lines (33 loc) · 924 Bytes

Max average selector complexity

Prevent the average selector complexity from exceeding a predefined maximum.

a b c {} a {} b {}
/*  ↑
*   complexity of all selectors counts towards the average */

This rule calculates the average complexity of all selectors in the stylesheet. This is different from specificity since :where(a b c d) has specificity [0, 0, 0] but is pretty complex.

Options

Number

Given:

2

the following are considered violations:

a b c d {} a {} b {}
#a .b [c="d"] {} a {}

The following patterns are not considered problems:

a b {} a {}
a {} b {} c {}

Prior art