UNPKG

2.36 kBMarkdownView Raw
1# value-list-comma-space-before
2
3Require a single space or disallow whitespace before the commas of value lists.
4
5<!-- prettier-ignore -->
6```css
7a { background-size: 0 ,0; }
8/** ↑
9 * The space before this comma */
10```
11
12The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix most 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 before the commas.
21
22The following patterns are considered violations:
23
24<!-- prettier-ignore -->
25```css
26a { background-size: 0,0; }
27```
28
29<!-- prettier-ignore -->
30```css
31a { background-size: 0
32 , 0; }
33```
34
35The following patterns are _not_ considered violations:
36
37<!-- prettier-ignore -->
38```css
39a { background-size: 0 ,0; }
40```
41
42<!-- prettier-ignore -->
43```css
44a { background-size: 0 ,
45 0; }
46```
47
48### `"never"`
49
50There _must never_ be whitespace before the commas.
51
52The following patterns are considered violations:
53
54<!-- prettier-ignore -->
55```css
56a { background-size: 0 ,0; }
57```
58
59<!-- prettier-ignore -->
60```css
61a { background-size: 0 ,
62 0; }
63```
64
65The following patterns are _not_ considered violations:
66
67<!-- prettier-ignore -->
68```css
69a { background-size: 0,0; }
70```
71
72<!-- prettier-ignore -->
73```css
74a { background-size: 0,
75 0; }
76```
77
78### `"always-single-line"`
79
80There _must always_ be a single space before the commas in single-line value lists.
81
82The following patterns are considered violations:
83
84<!-- prettier-ignore -->
85```css
86a { background-size: 0,0; }
87```
88
89The following patterns are _not_ considered violations:
90
91<!-- prettier-ignore -->
92```css
93a { background-size: 0 ,0; }
94```
95
96<!-- prettier-ignore -->
97```css
98a { background-size: 0 ,
99 0; }
100```
101
102<!-- prettier-ignore -->
103```css
104a { background-size: 0
105 , 0; }
106```
107
108### `"never-single-line"`
109
110There _must never_ be whitespace before the commas in single-line value lists.
111
112The following patterns are considered violations:
113
114<!-- prettier-ignore -->
115```css
116a { background-size: 0 ,0; }
117```
118
119The following patterns are _not_ considered violations:
120
121<!-- prettier-ignore -->
122```css
123a { background-size: 0,0; }
124```
125
126<!-- prettier-ignore -->
127```css
128a { background-size: 0,
129 0; }
130```
131
132<!-- prettier-ignore -->
133```css
134a { background-size: 0 ,
135 0; }
136```