Skip to content

Dotted layer name in @layer rule throws an error in Less 4.4.0 (regression)Β #4348

@n3dst4

Description

@n3dst4

To reproduce:

πŸ‘‰οΈ Playground link πŸ‘ˆοΈ

  1. Write a CSS @layer rule in a .less stylesheet addressing a nested layer using dotted notation:

    @layer foo.baz {
       .bar {
           font-weight: bold;
       }
    }
  2. Process it:

    npx less stylesheet.less
    
  3. Bang:

    Error: [less] at-rule options not recognised

Current behavior:

lessc throws an error on the dotted syntax.

Expected behavior:

The dotted syntax should pass through lessc the same way as a non-dotted rule.

Environment information:

  • less version: 4.4.0
  • nodejs version: 22.17.0
  • operating system: Linux

Other links

MDN Link about nested CSS layers

Playground example of a non-dotted layer name working great in 4.4.0

Playground example of the dotted notation working in 4.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions