Skip to main content

at-rule-property-required-list

为 at-rule 指定所需属性(或描述符)的列表。

¥Specify a list of required properties (or descriptors) for an at-rule.

    @font-face { font-display: swap; font-family: 'foo'; }
/** ↑ ↑ ↑

* At-rule and required descriptor names */

message 次要选项 可以接受该规则的参数。

¥The message secondary option can accept the arguments of this rule.

选项

¥Options

object{ "at-rule-name": ["array", "of", "properties or descriptors"]|"property or descriptor" }

鉴于:

¥Given:

{
"font-face": ["font-display", "font-family", "font-style"]
}

以下模式被视为问题:

¥The following patterns are considered problems:

@font-face {
font-family: 'foo';
src: url('./fonts/foo.woff2') format('woff2');
}
@font-face {
font-family: 'foo';
font-style: normal;
src: url('./fonts/foo.woff2') format('woff2');
}

以下模式不被视为问题:

¥The following patterns are not considered problems:

@font-face {
font-display: swap;
font-family: 'foo';
font-style: normal;
src: url('./fonts/foo.woff2') format('woff2');
}