1 # selector-max-specificity
3 Limit the specificity of selectors.
6 .foo, #bar.baz span, #hoo { color: pink; }
8 * Each of these selectors */
11 Visit the [Specificity Calculator](https://specificity.keegan.st) for visual representation of selector specificity.
13 This rule ignores selectors with variable interpolation (`#{$var}`, `@{var}`, `$(var)`).
15 This rule resolves nested selectors before calculating the specificity of a selector.
19 `string`: Maximum specificity allowed.
21 Format is `"id,class,type"`, as laid out in the [W3C selector spec](https://drafts.csswg.org/selectors/#specificity-rules).
23 For example, with `"0,2,0"`:
25 The following patterns are considered violations:
50 The following patterns are *not* considered violations:
81 ## Optional secondary options
83 ### `ignoreSelectors: ["/regex/", "string"]`
89 ignoreSelectors: [":global", ":local", "/my-/"]
93 The following patterns are *not* considered violations:
104 :local(.foo, :global(.bar).baz)
107 The following patterns are considered violations:
110 :global(.foo) .bar.baz {}
118 :local(.foo, :global(.bar), .foo.bar.baz)