Skip to main content

no-invalid-position-declaration

禁止无效的位置声明。

¥Disallow invalid position declarations.

color: red;
/** ↑

* This declaration */

声明只能定位在 <declaration-list><declaration-rule-list><block-contents> 产生式中。

¥Declarations can only be positioned within the <declaration-list>, <declaration-rule-list> and <block-contents> productions.

选项

¥Options

true

{
"no-invalid-position-declaration": true
}

以下模式被视为问题:

¥The following patterns are considered problems:

color: red;
--foo: red;
@media all {
color: red;
}

以下模式不被视为问题:

¥The following patterns are not considered problems:

a { color: red; }
a { --foo: red; }
@media all {
a {
color: red;
}
}