.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / selector-pseudo-element-colon-notation / README.md
1 # selector-pseudo-element-colon-notation
2
3 Specify single or double colon notation for applicable pseudo-elements.
4
5 ```css
6    a::before { color:pink; }
7 /** ↑
8  * This notation */
9 ```
10
11 The `::` notation was chosen for *pseudo-elements* to establish a discrimination between *pseudo-classes* (which subclass existing elements) and *pseudo-elements* (which are elements not represented in the document tree).
12
13 However, for compatibility with existing style sheets, user agents also accept the previous one-colon notation for *pseudo-elements* introduced in CSS levels 1 and 2 (namely, `:first-line`, `:first-letter`, `:before` and `:after`).
14
15 ## Options
16
17 `string`: `"single"|"double"`
18
19 ### `"single"`
20
21 Applicable pseudo-elements *must always* use the single colon notation.
22
23 The following patterns are considered violations:
24
25 ```css
26 a::before { color: pink; }
27 ```
28
29 ```css
30 a::after { color: pink; }
31 ```
32
33 ```css
34 a::first-letter { color: pink; }
35 ```
36
37 ```css
38 a::first-line { color: pink; }
39 ```
40
41 The following patterns are *not* considered violations:
42
43 ```css
44 a:before { color: pink; }
45 ```
46
47 ```css
48 a:after { color: pink; }
49 ```
50
51 ```css
52 a:first-letter { color: pink; }
53 ```
54
55 ```css
56 a:first-line { color: pink; }
57 ```
58
59 ```css
60 input::placeholder { color: pink; }
61 ```
62
63 ```css
64 li::marker { font-variant-numeric: tabular-nums; }
65 ```
66
67 ### `"double"`
68
69 Applicable pseudo-elements *must always* use the double colon notation.
70
71 The following patterns are considered violations:
72
73 ```css
74 a:before { color: pink; }
75 ```
76
77 ```css
78 a:after { color: pink; }
79 ```
80
81 ```css
82 a:first-letter { color: pink; }
83 ```
84
85 ```css
86 a:first-line { color: pink; }
87 ```
88
89 The following patterns are *not* considered violations:
90
91 ```css
92 a::before { color: pink; }
93 ```
94
95 ```css
96 a::after { color: pink; }
97 ```
98
99 ```css
100 a::first-letter { color: pink; }
101 ```
102
103 ```css
104 a::first-line { color: pink; }
105 ```
106
107 ```css
108 input::placeholder { color: pink; }
109 ```
110
111 ```css
112 li::marker { font-variant-numeric: tabular-nums; }
113 ```