Skip to main content

rule-nesting-at-rule-required-list

Require rules to be nested in specific at-rules.

a { color: red; }
/** ↑
* This rule */

Options

Array<string | RegExp>

Given:

{
"rule-nesting-at-rule-required-list": ["layer", "/^--foo-/"]
}

The following patterns are considered problems:

a { color: red; }
@media all {
a { color: red; }
}
a {
@layer {
color: red;
}
}

The following patterns are not considered problems:

@layer {
a { color: red; }
}
@--foo-bar {
a { color: red; }
}
@--foo-baz {
a { color: red; }
}
@font-face {
font-family: "foo";
}