layer-name-pattern
Specify a pattern for layer names.
@layer foo {}/** ↑ * This layer name */Use this rule to enforce a convention. For example, require kebab-case names for consistency with the specifications’ examples.
This rule supports 2 message arguments: the layer name and the configured pattern.
Options
Section titled “Options”string
Section titled “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);