UNPKG

1.84 kBMarkdownView Raw
1# at-rule-name-space-after
2
3Require a single space after at-rule names.
4
5<!-- prettier-ignore -->
6```css
7@media (max-width: 600px) {}
8/** ↑
9 * The space after at-rule names */
10```
11
12The [`fix` option](../../../docs/user-guide/usage/options.md#fix) can automatically fix all of the problems reported by this rule.
13
14## Options
15
16`string`: `"always"|"always-single-line"`
17
18### `"always"`
19
20There _must always_ be a single space after at-rule names.
21
22The following patterns are considered violations:
23
24<!-- prettier-ignore -->
25```css
26@charset"UTF-8";
27```
28
29<!-- prettier-ignore -->
30```css
31@media(min-width: 700px) {}
32```
33
34<!-- prettier-ignore -->
35```css
36@media (min-width: 700px) {}
37```
38
39<!-- prettier-ignore -->
40```css
41@media
42(min-width: 700px) {}
43```
44
45The following patterns are _not_ considered violations:
46
47<!-- prettier-ignore -->
48```css
49@charset "UTF-8";
50```
51
52<!-- prettier-ignore -->
53```css
54@import url("x.css");
55```
56
57<!-- prettier-ignore -->
58```css
59@media (min-width: 700px) {}
60```
61
62### `"always-single-line"`
63
64There _must always_ be a single space after at-rule names in single-line declaration blocks.
65
66The following patterns are considered violations:
67
68<!-- prettier-ignore -->
69```css
70@charset"UTF-8";
71```
72
73<!-- prettier-ignore -->
74```css
75@media(min-width: 700px) {}
76```
77
78<!-- prettier-ignore -->
79```css
80@media (min-width: 700px) {}
81```
82
83The following patterns are _not_ considered violations:
84
85<!-- prettier-ignore -->
86```css
87@charset "UTF-8";
88```
89
90<!-- prettier-ignore -->
91```css
92@import url("x.css");
93```
94
95<!-- prettier-ignore -->
96```css
97@media (min-width: 700px) {}
98```
99
100<!-- prettier-ignore -->
101```css
102@media
103(min-width: 700px) {}
104```
105
106<!-- prettier-ignore -->
107```css
108@media(min-width: 700px) and
109 (orientation: portrait) {}
110```
111
112<!-- prettier-ignore -->
113```css
114@media
115 (min-width: 700px) and
116 (orientation: portrait) {}
117```