UNPKG

986 BMarkdownView Raw
1# at-rule-property-requirelist
2
3Specify a requirelist of properties for an at-rule.
4
5<!-- prettier-ignore -->
6```css
7 @font-face { font-display: swap; font-family: 'foo'; }
8/** ↑ ↑ ↑
9 * At-rule and required property names */
10```
11
12## Options
13
14`object`: `{ "at-rule-name": ["array", "of", "properties"] }`
15
16Given:
17
18```
19{
20 "font-face": ["font-display", "font-family", "font-style"]
21}
22```
23
24The following patterns are considered violations:
25
26<!-- prettier-ignore -->
27```css
28@font-face {
29 font-family: 'foo';
30 src: url('./fonts/foo.woff2') format('woff2');
31}
32```
33
34<!-- prettier-ignore -->
35```css
36@font-face {
37 font-family: 'foo';
38 font-style: normal;
39 src: url('./fonts/foo.woff2') format('woff2');
40}
41```
42
43The following patterns are _not_ considered violations:
44
45<!-- prettier-ignore -->
46```css
47@font-face {
48 font-display: swap;
49 font-family: 'foo';
50 font-style: normal;
51 src: url('./fonts/foo.woff2') format('woff2');
52}
53```