.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / custom-property-empty-line-before / README.md
1 # custom-property-empty-line-before
2
3 Require or disallow an empty line before custom properties.
4
5 ```css
6 a {
7   top: 10px;
8                           /* ← */
9   --foo: pink;            /* ↑ */
10 }                         /* ↑ */
11 /**                          ↑
12  *                   This line */
13 ```
14
15 The `--fix` option on the [command line](../../../docs/user-guide/cli.md#autofixing-errors) can automatically fix all of the problems reported by this rule. We recommend to enable [`indentation`](../indentation/README.md) rule for better autofixing results with this rule.
16
17 ## Options
18
19 `string`: `"always"|"never"`
20
21 ### `"always"`
22
23 The following patterns are considered violations:
24
25 ```css
26 a {
27   top: 10px;
28   --foo: pink;
29   --bar: red;
30 }
31 ```
32
33 The following patterns are *not* considered violations:
34
35 ```css
36 a {
37   top: 10px;
38
39   --foo: pink;
40
41   --bar: red;
42 }
43 ```
44
45 ### `"never"`
46
47 The following patterns are considered violations:
48
49 ```css
50 a {
51   top: 10px;
52
53   --foo: pink;
54
55   --bar: red;
56 }
57 ```
58
59 ```css
60 a {
61
62   --foo: pink;
63   --bar: red;
64 }
65 ```
66
67 The following patterns are *not* considered violations:
68
69 ```css
70 a {
71   top: 10px;
72   --foo: pink;
73   --bar: red;
74 }
75 ```
76
77 ```css
78 a {
79   --foo: pink;
80   --bar: red;
81 }
82 ```
83
84 ## Optional secondary options
85
86 ### `except: ["after-comment", "after-custom-property", "first-nested"]`
87
88 #### `"after-comment"`
89
90 Reverse the primary option for custom properties that come after a comment.
91
92 Shared-line comments do not trigger this option.
93
94 For example, with `"always"`:
95
96 The following patterns are considered violations:
97
98 ```css
99 a {
100
101   --foo: pink;
102   /* comment */
103
104   --bar: red;
105 }
106 ```
107
108 ```css
109 a {
110
111   --foo: pink; /* comment */
112   --bar: red;
113 }
114 ```
115
116 The following patterns are *not* considered violations:
117
118 ```css
119 a {
120
121   --foo: pink;
122   /* comment */
123   --bar: red;
124 }
125 ```
126
127 ```css
128 a {
129
130   --foo: pink; /* comment */
131
132   --bar: red;
133 }
134 ```
135
136 #### `"after-custom-property"`
137
138 Reverse the primary option for custom properties that come after another custom property.
139
140 Shared-line comments do not affect this option.
141
142 For example, with `"always"`:
143
144 The following patterns are considered violations:
145
146 ```css
147 a {
148
149   --foo: pink;
150
151   --bar: red;
152 }
153 ```
154
155 ```css
156 a {
157
158   --foo: pink; /* comment */
159
160   --bar: red;
161 }
162 ```
163
164 The following patterns are *not* considered violations:
165
166 ```css
167 a {
168
169   --foo: pink;
170   --bar: red;
171 }
172 ```
173
174 ```css
175 a {
176
177   --foo: pink; /* comment */
178   --bar: red;
179 }
180 ```
181
182 #### `"first-nested"`
183
184 Reverse the primary option for custom properties that are nested and the first child of their parent node.
185
186 For example, with `"always"`:
187
188 The following patterns are considered violations:
189
190 ```css
191 a {
192
193   --foo: pink;
194
195   --bar: red;
196 }
197 ```
198
199 The following patterns are *not* considered violations:
200
201 ```css
202 a {
203   --foo: pink;
204
205   --bar: red;
206 }
207 ```
208
209 ### `ignore: ["after-comment", "inside-single-line-block"]`
210
211 #### `"after-comment"`
212
213 Ignore custom properties that are preceded by comments.
214
215 For example, with `"always"`:
216
217 The following patterns are *not* considered violations:
218
219 ```css
220 a {
221   /* comment */
222   --foo: pink;
223 }
224 ```
225
226 #### `"inside-single-line-block"`
227
228 Ignore custom properties that are inside single-line blocks.
229
230 For example, with `"always"`:
231
232 The following patterns are *not* considered violations:
233
234 ```css
235 a { --foo: pink; --bar: red; }
236 ```