Skip to main content

at-rule-no-unknown

禁止未知的 at 规则。

¥Disallow unknown at-rules.

    @unknown (max-width: 960px) {}
/** ↑

* At-rules like this */

此规则认为 CSS 规范中定义的 at 规则(直至并包括编辑草稿)是已知的。

¥This rule considers at-rules defined in the CSS Specifications, up to and including Editor's Drafts, to be known.

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

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

选项

¥Options

true

以下模式被视为问题:

¥The following patterns are considered problems:

@unknown {}

以下模式不被视为问题:

¥The following patterns are not considered problems:

@charset "UTF-8";
@CHARSET "UTF-8";
@media (max-width: 960px) {}
@font-feature-values Font One {
@styleset {}
}

可选的辅助选项

¥Optional secondary options

ignoreAtRules: ["/regex/", /regex/, "string"]

鉴于:

¥Given:

["/^--my-/", "--custom"]

以下模式不被视为问题:

¥The following patterns are not considered problems:

@--my-at-rule "x.css";
@--my-other-at-rule {}
@--custom {}