Skip to main content

at-rule-prelude-no-invalid

禁止在 at 规则中使用无效前奏。

¥Disallow invalid preludes for at-rules.

@property --foo {}
/** ↑

* Preludes like this */

此规则认为 CSS 规范中定义的 at 规则的前奏(包括编辑草稿)有效。

¥This rule considers preludes for at-rules defined within the CSS specifications, up to and including Editor's Drafts, to be valid.

你可以过滤 CSSTree 语法参考 以找出有效的规则前置词。

¥You can filter the CSSTree Syntax Reference to find out what preludes are valid for an at-rule.

此规则仅适用于 CSS。你不应该为类似 CSS 的语言(例如 SCSS 或 Less)启用它。

¥This rule is only appropriate for CSS. You should not turn it on for CSS-like languages, such as SCSS or Less.

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

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

此规则与以下内容重叠:

¥This rule overlaps with:

你可以关闭规则或将其配置为忽略重叠。

¥You can either turn off the rules or configure them to ignore the overlaps.

现有技术:

¥Prior art:

选项

¥Options

true

以下模式被视为问题:

¥The following patterns are considered problems:

@property foo {}
@font-palette-values foo {}

以下模式不被视为问题:

¥The following patterns are not considered problems:

@property --foo {}
@font-palette-values --foo {}

辅助选项

¥Secondary Options

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

鉴于:

¥Given:

["property", "/^font-/"]

以下模式不被视为问题:

¥The following patterns are not considered problems:

@property foo;
@font-palette-values foo {}