CSS Nesting
I’m thrilled to see a repository with tokenization for HTML, CSS, and JS.
I may have found a couple issues.
Since the 2013 edition of the CSS Syntax specification, the handling for nesting at-rules has been defined, so that at-rules can be successfully consumed, even if their contents are only considered a series of component values.
This does not appear to be supported in this project.
In the 2021 edition of the CSS Syntax specification, this support has been expanded to include the & nesting selector which consumes qualified rules.
This does not appear to be supported in this project.
Hi Jonathan, thanks for reporting the issue! I want to fix both issues but I have to confess that I have limited time to dedicate at the moment.
I was under the impression that at rules must contain qualified rules (selector + declaration block), but it appears that it may contain instead a declaration as well.
I'm not entirely sure what you mean with nesting at-rules. In your example I see that @media{color:blue} is not yet supported and I'm working on that, but what do you mean with nested at-rules? Can you give an example?
Relevant documentation is here: https://drafts.csswg.org/css-syntax/#declaration-rule-list For each at-rule it is defined where it may contain qualified rules or declarations.