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 #92

Open
jonathantneal opened this issue Dec 5, 2021 · 5 comments
Open

CSS Nesting #92

jonathantneal opened this issue Dec 5, 2021 · 5 comments

Comments

@jonathantneal
Copy link

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.

@tdewolff
Copy link
Owner

tdewolff commented Dec 7, 2021

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
Copy link
Owner

tdewolff commented Dec 7, 2021

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
Copy link
Owner

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.

@GraphR00t
Copy link

@tdewolff

CSS nesting is now supported by most major browser vendors: https://caniuse.com/?search=CSS%20nesting
Even though the specification is not finalized it would be great to have partial support for it.

Thank you for your work on this Go module !

@tdewolff
Copy link
Owner

Great idea, this will definitely be a great way to compress CSS files further and I'll put it on the roadmap when I have time to work on the new CSS parser!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants