.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / selector-max-combinators / README.md
1 # selector-max-combinators
2
3 Limit the number of combinators in a selector.
4
5 ```css
6   a > b + c ~ d e { color: pink; }
7 /** ↑   ↑   ↑  ↑
8  * These are combinators */
9 ```
10
11 This rule resolves nested selectors before counting the number of combinators selectors. Each selector in a [selector list](https://www.w3.org/TR/selectors4/#selector-list) is evaluated separately.
12
13 ## Options
14
15 `int`: Maximum combinators selectors allowed.
16
17 For example, with `2`:
18
19 The following patterns are considered violations:
20
21 ```css
22 a b ~ c + d {}
23 ```
24
25 ```css
26 a b ~ c {
27   & > d {}
28 }
29 ```
30
31 ```css
32 a b {
33   & ~ c {
34     & + d {}
35   }
36 }
37 ```
38
39 The following patterns are *not* considered violations:
40
41 ```css
42 a {}
43 ```
44
45 ```css
46 a b {}
47 ```
48
49 ```css
50 a b ~ c {}
51 ```
52
53 ```css
54 a b {
55   & ~ c {}
56 }
57 ```
58
59 ```css
60 /* each selector in a selector list is evaluated separately */
61 a b,
62 c > d {}
63 ```