UNPKG

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