1 | # media-query-list-comma-newline-after
|
2 |
|
3 | Require a newline or disallow whitespace after the commas of media query lists.
|
4 |
|
5 |
|
6 | ```css
|
7 | @media screen and (color),
|
8 | projection {} /* ↑ */
|
9 | /** ↑
|
10 | * These commas */
|
11 | ```
|
12 |
|
13 | The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all 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 | @media screen and (color), projection and (color) {}
|
28 | ```
|
29 |
|
30 |
|
31 | ```css
|
32 | @media screen and (color)
|
33 | , projection and (color) {}
|
34 | ```
|
35 |
|
36 | The following patterns are _not_ considered violations:
|
37 |
|
38 |
|
39 | ```css
|
40 | @media screen and (color),
|
41 | projection and (color) {}
|
42 | ```
|
43 |
|
44 |
|
45 | ```css
|
46 | @media screen and (color)
|
47 | ,
|
48 | projection and (color) {}
|
49 | ```
|
50 |
|
51 | ### `"always-multi-line"`
|
52 |
|
53 | There _must always_ be a newline after the commas in multi-line media query lists.
|
54 |
|
55 | The following patterns are considered violations:
|
56 |
|
57 |
|
58 | ```css
|
59 | @media screen and (color)
|
60 | , projection and (color) {}
|
61 | ```
|
62 |
|
63 | The following patterns are _not_ considered violations:
|
64 |
|
65 |
|
66 | ```css
|
67 | @media screen and (color), projection and (color) {}
|
68 | ```
|
69 |
|
70 |
|
71 | ```css
|
72 | @media screen and (color),
|
73 | projection and (color) {}
|
74 | ```
|
75 |
|
76 |
|
77 | ```css
|
78 | @media screen and (color)
|
79 | ,
|
80 | projection and (color) {}
|
81 | ```
|
82 |
|
83 | ### `"never-multi-line"`
|
84 |
|
85 | There _must never_ be whitespace after the commas in multi-line media query lists.
|
86 |
|
87 | The following patterns are considered violations:
|
88 |
|
89 |
|
90 | ```css
|
91 | @media screen and (color),
|
92 | projection and (color) {}
|
93 | ```
|
94 |
|
95 |
|
96 | ```css
|
97 | @media screen and (color)
|
98 | ,
|
99 | projection and (color) {}
|
100 | ```
|
101 |
|
102 | The following patterns are _not_ considered violations:
|
103 |
|
104 |
|
105 | ```css
|
106 | @media screen and (color), projection and (color) {}
|
107 | ```
|
108 |
|
109 |
|
110 | ```css
|
111 | @media screen and (color)
|
112 | ,projection and (color) {}
|
113 | ```
|