Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cdoublev opened this issue Apr 14, 2023 · 2 comments
Closed
Labels
Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered.

Comments

@cdoublev
Copy link
Collaborator

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 [...]

@tabatkins
Copy link
Member

I also don't see any particular reason to allow the @layer statement inside of style rules; it's just as meaningless as putting a @font-face in there. We could allow it, but there's literally zero benefit to doing so.

While the links don't distinguish between at-rules and at-statements, all the text is specifically talking about the rule form.

@cdoublev
Copy link
Collaborator Author

Ok. (Again,) I have no problem with this position but I needed it clarified. Thanks!

@cdoublev cdoublev added the Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered. label Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed as Question Answered Used when the issue is more of a question than a problem, and it's been answered.
Projects
None yet
Development

No branches or pull requests

2 participants