Skip to main content

layer-name-pattern

指定层名称的模式。

¥Specify a pattern for layer names.

@layer foo {}
/** ↑

* This layer name */

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

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

选项

¥Options

regex|string

字符串将被转换为正则表达式,如 new RegExp(yourString) — 因此请务必正确转义。

¥A string will be translated into a RegExp like so new RegExp(yourString) — so be sure to escape properly.

给定字符串:

¥Given the string:

"^[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);