Skip to content

[css-nesting-1] Is @layer statement allowed to be nested in style rules? #8714

@cdoublev

Description

@cdoublev

The normative text does not allow it (emphasize added):

In addition to nested style rules, this specification allows nested group rules inside of style rules: any at-rule whose body contains style rules can be nested inside of a style rule as well.

However the following non-normative note links to the general @layer definition (for both block and statement @layer):

Specifically, these rules are capable of being nested group rules:

  • all the conditional group rules (@media, @supports)
  • @layer
  • @scope
  • @container

I do not see any non-contrived use of @layer statement nested in style rules but I also do not see a good reason to not allow it other than finding an appropriate term to replace nested group rules. Maybe nested conditional and cascade rules?

Note that @container is already defined as a conditional group rule:

The @container rule is a conditional group rule whose condition contains a container query [...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions