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