Skip to content

Fix layer-name-pattern false positives for dot notation #372

@jhae-de

Description

@jhae-de

What is the problem you're trying to solve?

Layers can be nested:

@layer layer {
  @layer nested-layer {
  }
}

To append rules to the nested layer, the layers can be joined using dot notation.

@layer layer.nested-layer {
  ...
}

Stylelint currently reports a problem here:

Expected layer name "layer.nested-layer" to be kebab-case (layer-name-pattern)

What solution would you like to see?

Change the pattern of the layer-name-pattern rule to:

^([a-z][a-z0-9]*)([.-][a-z0-9]+)*$

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions