Open
Conversation
Contributor
Author
|
I tried a couple times to get the nested element selectors working and I couldn't figure it out. @lahmatiy I'd appreciate some guidance here. |
Contributor
Author
|
@lahmatiy friendly reminder I'm looking for feedback here. Nesting is a pretty important feature and it's difficult to use CSSTree on modern CSS without some kind of support for it. |
|
👍 lets have this one please! |
Contributor
Author
|
@gbrlmtrz you can check out the ESLint fork, which has support for most nested selectors: https://github.com/eslint/csstree. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request includes changes to improve the handling of nested selectors in the
Blockparsing logic and updates to the corresponding test fixtures.Note: I couldn't quite figure out how to detect element selectors for nesting. All of the other selector types are supported. I could use some help figuring out the element selector piece.
Fixes #268
Improvements to nested selector handling:
lib/syntax/node/Block.js: Added support for new selector types includingDelim,Hash,Colon, andLeftSquareBracket, and introduced a new functionisSelectorStartto improve detection of selector starts. [1] [2] [3]Updates to test fixtures:
fixtures/ast/rule/nesting.json: Updated test cases to include various nested selector scenarios such as nested class selectors, ID selectors, attribute selectors, universal selectors, and pseudo-class selectors. [1] [2] [3]