-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Parse nested element selector #51
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
Conversation
Pull Request Test Coverage Report for Build 15310219514Details
💛 - Coveralls |
@@ -60,8 +75,7 @@ export const structure = { | |||
]] | |||
}; | |||
|
|||
export function parse(isStyleBlock) { | |||
const consumer = isStyleBlock ? consumeDeclaration : consumeRule; | |||
export function parse(isStyleBlock, { allowNestedRules = false } = {}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed to add a new parameter because previously isStyleBlock
meant it could only contain declarations, which is still true for at-rules but not for regular rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Leaving it open for 2nd review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
This adds support for parsing most nested element selectors:
The only pattern it doesn't currently cover is when a pseudoclass or pseudoelement is immediately attached to the element, like this:
That's because
a:hover
looks like a property and I haven't yet figured out an efficient way to discover whether it's a property or a selector.refs #33