UNPKG

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