UNPKG

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