Skip to main content

layer-name-pattern

Specify a pattern for layer names.

@layer foo {}
/** ↑
* This layer name */

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

Options

string

Specify a regex string not surrounded with "/".

Given:

{
"layer-name-pattern": "^[a-z][a-z0-9.-]*$"
}

The following patterns are considered problems:

@layer Foo;
@layer foo.Bar {}
@layer foo, Bar {}
@import "foo.css" layer(Bar);

The following patterns are not considered problems:

@layer foo;
@layer foo.bar {}
@layer foo, bar {}
@import "foo.css" layer(bar);