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