1 | # media-query-list-comma-space-after
|
2 |
|
3 | Require a single space or disallow whitespace after the commas of media query lists.
|
4 |
|
5 | ```css
|
6 | @media screen and (color), projection and (color) {}
|
7 | /** ↑
|
8 | * The space after this comma */
|
9 | ```
|
10 |
|
11 | The `--fix` option on the [command line](../../../docs/user-guide/cli.md#autofixing-errors) can automatically fix all of the problems reported by this rule.
|
12 |
|
13 | ## Options
|
14 |
|
15 | `string`: `"always"|"never"|"always-single-line"|"never-single-line"`
|
16 |
|
17 | ### `"always"`
|
18 |
|
19 | There *must always* be a single space after the commas.
|
20 |
|
21 | The following patterns are considered violations:
|
22 |
|
23 | ```css
|
24 | @media screen and (color),projection and (color) {}
|
25 | ```
|
26 |
|
27 | ```css
|
28 | @media screen and (color)
|
29 | ,projection and (color) {}
|
30 | ```
|
31 |
|
32 | The following patterns are *not* considered violations:
|
33 |
|
34 | ```css
|
35 | @media screen and (color), projection and (color) {}
|
36 | ```
|
37 |
|
38 | ```css
|
39 | @media screen and (color)
|
40 | , projection and (color) {}
|
41 | ```
|
42 |
|
43 | ### `"never"`
|
44 |
|
45 | There *must never* be whitespace after the commas.
|
46 |
|
47 | The following patterns are considered violations:
|
48 |
|
49 | ```css
|
50 | @media screen and (color), projection and (color) {}
|
51 | ```
|
52 |
|
53 | ```css
|
54 | @media screen and (color)
|
55 | , projection and (color) {}
|
56 | ```
|
57 |
|
58 | The following patterns are *not* considered violations:
|
59 |
|
60 | ```css
|
61 | @media screen and (color),projection and (color) {}
|
62 | ```
|
63 |
|
64 | ```css
|
65 | @media screen and (color)
|
66 | ,projection and (color) {}
|
67 | ```
|
68 |
|
69 | ### `"always-single-line"`
|
70 |
|
71 | There *must always* be a single space after the commas in single-line media query lists.
|
72 |
|
73 | The following patterns are considered violations:
|
74 |
|
75 | ```css
|
76 | @media screen and (color),projection and (color) {}
|
77 | ```
|
78 |
|
79 | The following patterns are *not* considered violations:
|
80 |
|
81 | ```css
|
82 | @media screen and (color), projection and (color) {}
|
83 | ```
|
84 |
|
85 | ```css
|
86 | @media screen and (color)
|
87 | , projection and (color) {}
|
88 | ```
|
89 |
|
90 | ```css
|
91 | @media screen and (color)
|
92 | ,projection and (color) {}
|
93 | ```
|
94 |
|
95 | ### `"never-single-line"`
|
96 |
|
97 | There *must never* be whitespace after the commas in single-line media query lists.
|
98 |
|
99 | The following patterns are considered violations:
|
100 |
|
101 | ```css
|
102 | @media screen and (color), projection and (color) {}
|
103 | ```
|
104 |
|
105 | The following patterns are *not* considered violations:
|
106 |
|
107 | ```css
|
108 | @media screen and (color),projection and (color) {}
|
109 | ```
|
110 |
|
111 | ```css
|
112 | @media screen and (color)
|
113 | ,projection and (color) {}
|
114 | ```
|
115 |
|
116 | ```css
|
117 | @media screen and (color)
|
118 | , projection and (color) {}
|
119 | ```
|