UNPKG

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