parse icon indicating copy to clipboard operation
parse copied to clipboard

CSS Nesting

Open jonathantneal opened this issue 4 years ago • 5 comments

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.

jonathantneal avatar Dec 05 '21 23:12 jonathantneal

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.

tdewolff avatar Dec 07 '21 12:12 tdewolff

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?

tdewolff avatar Dec 07 '21 21:12 tdewolff

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.

tdewolff avatar Dec 11 '21 13:12 tdewolff