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] keeping track of what can and can not be nested #9114

Open
romainmenke opened this issue Jul 25, 2023 · 2 comments
Open

[css-nesting] keeping track of what can and can not be nested #9114

romainmenke opened this issue Jul 25, 2023 · 2 comments
Labels
css-nesting-1 Current Work

Comments

@romainmenke
Copy link
Member

Nesting is a high maintenance feature for tooling (transpilers, linters, ...) and code editors.

With each new at-rule that can be nested these tools need to be updated to specifically allow both declarations and style rules.

This is different from before where allowing only style rules was a sane default for unknown at-rules.

It would be helpful if there was an authoritative and exhaustive list of all at-rules that are allowed in nesting so that maintainers do not have to read every single specification to gather the complete list.

example :
css-transitions-2 introduces @starting-style which can be nested : https://drafts.csswg.org/css-transitions-2/#example-8d9992e9


I think it would even be reasonable if only css-nesting defines which at-rules can be nested.

@romainmenke
Copy link
Member Author

romainmenke commented Jul 25, 2023

Alternatively making it possible to scrape this aspect so that it can be part of something like webref would also help.

@cdoublev
Copy link
Collaborator

Alternatively making it possible to scrape this aspect so that it can be part of something like webref would also help.

I would be interested too. Rule definition tables may be more appropriate than production rules:

      Name:  foo
   Prelude:  <prelude>
     Block:  <block-contents>
Properties:  list of accepted/excluded properties
     Rules:  list of accepted/excluded rules
   Cascade:  yes, ... (optional - but conventional - prose)

New CSS rules (or updates to the above features) are rare, though.


I think it would even be reasonable if only css-nesting defines which at-rules can be nested.

This list in CSS Nesting (2.2. Nesting Other At-Rules) may need to be updated:

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-nesting-1 Current Work
Projects
None yet
Development

No branches or pull requests

3 participants