1 | # media-query-list-comma-newline-before
|
2 |
|
3 | Require a newline or disallow whitespace before the commas of media query lists.
|
4 |
|
5 |
|
6 | ```css
|
7 | @media screen and (color)
|
8 | , projection and (color) {}
|
9 | /** ↑
|
10 | * This comma */
|
11 | ```
|
12 |
|
13 | ## Options
|
14 |
|
15 | `string`: `"always"|"always-multi-line"|"never-multi-line"`
|
16 |
|
17 | ### `"always"`
|
18 |
|
19 | There _must always_ be a newline before the commas.
|
20 |
|
21 | The following patterns are considered violations:
|
22 |
|
23 |
|
24 | ```css
|
25 | @media screen and (color), projection and (color) {}
|
26 | ```
|
27 |
|
28 |
|
29 | ```css
|
30 | @media screen and (color),
|
31 | projection and (color) {}
|
32 | ```
|
33 |
|
34 | The following patterns are _not_ considered violations:
|
35 |
|
36 |
|
37 | ```css
|
38 | @media screen and (color)
|
39 | ,projection and (color) {}
|
40 | ```
|
41 |
|
42 |
|
43 | ```css
|
44 | @media screen and (color)
|
45 | ,
|
46 | projection and (color) {}
|
47 | ```
|
48 |
|
49 | ### `"always-multi-line"`
|
50 |
|
51 | There _must always_ be a newline before the commas in multi-line media query lists.
|
52 |
|
53 | The following patterns are considered violations:
|
54 |
|
55 |
|
56 | ```css
|
57 | @media screen and (color),
|
58 | projection and (color) {}
|
59 | ```
|
60 |
|
61 | The following patterns are _not_ considered violations:
|
62 |
|
63 |
|
64 | ```css
|
65 | @media screen and (color), projection and (color) {}
|
66 | ```
|
67 |
|
68 |
|
69 | ```css
|
70 | @media screen and (color)
|
71 | ,projection and (color) {}
|
72 | ```
|
73 |
|
74 |
|
75 | ```css
|
76 | @media screen and (color)
|
77 | ,
|
78 | projection and (color) {}
|
79 | ```
|
80 |
|
81 | ### `"never-multi-line"`
|
82 |
|
83 | There _must never_ be whitespace before the commas in multi-line media query lists.
|
84 |
|
85 | The following patterns are considered violations:
|
86 |
|
87 |
|
88 | ```css
|
89 | @media screen and (color)
|
90 | ,projection and (color) {}
|
91 | ```
|
92 |
|
93 |
|
94 | ```css
|
95 | @media screen and (color)
|
96 | ,
|
97 | projection and (color) {}
|
98 | ```
|
99 |
|
100 | The following patterns are _not_ considered violations:
|
101 |
|
102 |
|
103 | ```css
|
104 | @media screen and (color), projection and (color) {}
|
105 | ```
|
106 |
|
107 |
|
108 | ```css
|
109 | @media screen and (color),
|
110 | projection and (color) {}
|
111 | ```
|