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.
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 {}- stylelint's
selector-max-compound-selectorsrule