1 # no-duplicate-selectors
3 Disallow duplicate selectors within a stylesheet.
6 .foo {} .bar {} .foo {}
11 This rule checks for two types of duplication:
13 - Duplication of a single selector with a rule's selector list, e.g. `a, b, a {}`.
14 - Duplication of a selector list within a stylesheet, e.g. `a, b {} a, b {}`. Duplicates are found even if the selectors come in different orders or have different spacing, e.g. `a d, b > c {} b>c, a d {}`.
16 The same selector *is* allowed to repeat in the following circumstances:
18 - It is used in different selector lists, e.g. `a {} a, b {}`.
19 - The duplicates are determined to originate in different stylesheets, e.g. you have concatenated or compiled files in a way that produces sourcemaps for PostCSS to read, e.g. postcss-import).
20 - The duplicates are in rules with different parent nodes, e.g. inside and outside of a media query.
22 This rule resolves nested selectors. So `a b {} a { & b {} }` counts as a violation, because the resolved selectors end up with a duplicate.
28 The following patterns are considered violations:
49 @media (min-width: 10px) {
74 The following patterns are *not* considered violations:
78 @media (min-width: 10px) {