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