1 | # selector-list-comma-newline-after
|
2 |
|
3 | Require a newline or disallow whitespace after the commas of selector lists.
|
4 |
|
5 |
|
6 | ```css
|
7 | a,
|
8 | b↑{ color: pink; }
|
9 | /** ↑
|
10 | * The newline after this comma */
|
11 | ```
|
12 |
|
13 | End-of-line comments are allowed one space after the comma.
|
14 |
|
15 |
|
16 | ```css
|
17 | a, /* comment */
|
18 | b { color: pink; }
|
19 | ```
|
20 |
|
21 | The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.
|
22 |
|
23 | ## Options
|
24 |
|
25 | `string`: `"always"|"always-multi-line"|"never-multi-line"`
|
26 |
|
27 | ### `"always"`
|
28 |
|
29 | There _must always_ be a newline after the commas.
|
30 |
|
31 | The following patterns are considered violations:
|
32 |
|
33 |
|
34 | ```css
|
35 | a, b { color: pink; }
|
36 | ```
|
37 |
|
38 |
|
39 | ```css
|
40 | a
|
41 | , b { color: pink; }
|
42 | ```
|
43 |
|
44 | The following patterns are _not_ considered violations:
|
45 |
|
46 |
|
47 | ```css
|
48 | a,
|
49 | b { color: pink; }
|
50 | ```
|
51 |
|
52 |
|
53 | ```css
|
54 | a
|
55 | ,
|
56 | b { color: pink; }
|
57 | ```
|
58 |
|
59 | ### `"always-multi-line"`
|
60 |
|
61 | There _must always_ be a newline after the commas in multi-line selector lists.
|
62 |
|
63 | The following patterns are considered violations:
|
64 |
|
65 |
|
66 | ```css
|
67 | a
|
68 | , b { color: pink; }
|
69 | ```
|
70 |
|
71 | The following patterns are _not_ considered violations:
|
72 |
|
73 |
|
74 | ```css
|
75 | a, b { color: pink; }
|
76 | ```
|
77 |
|
78 |
|
79 | ```css
|
80 | a,
|
81 | b { color: pink; }
|
82 | ```
|
83 |
|
84 |
|
85 | ```css
|
86 | a
|
87 | ,
|
88 | b { color: pink; }
|
89 | ```
|
90 |
|
91 | ### `"never-multi-line"`
|
92 |
|
93 | There _must never_ be whitespace after the commas in multi-line selector lists.
|
94 |
|
95 | The following patterns are considered violations:
|
96 |
|
97 |
|
98 | ```css
|
99 | a
|
100 | , b { color: pink; }
|
101 | ```
|
102 |
|
103 |
|
104 | ```css
|
105 | a,
|
106 | b { color: pink; }
|
107 | ```
|
108 |
|
109 | The following patterns are _not_ considered violations:
|
110 |
|
111 |
|
112 | ```css
|
113 | a,b { color: pink; }
|
114 | ```
|
115 |
|
116 |
|
117 | ```css
|
118 | a
|
119 | ,b { color: pink; }
|
120 | ```
|