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

postcss-nesting: fix pseudo's and allow ampersand everywhere #683

Conversation

romainmenke
Copy link
Member

Comment on lines +7 to +13
while (parent) {
if (parent.type === 'rule') {
return;
}

parent = parent.parent;
}
Copy link
Member Author

@romainmenke romainmenke Nov 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to be sure that & was "detected" in a rule that isn't itself nested.

Nested CSS can exist after transforms when it was invalid.

Comment on lines -34 to -38
// see : https://github.com/w3c/csswg-drafts/issues/7979
if (parser.isPseudoElement(maybeCombinator)) {
startsWithCombinator = true;
return false;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am following what Chrome did and I agree with their analysis : w3c/csswg-drafts#7979 (comment)

Copy link
Member

@Antonio-Laguna Antonio-Laguna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, should we go minor? Not that it matters a lot but let me know if you disagree

@romainmenke
Copy link
Member Author

Minor is good :)

@romainmenke romainmenke merged commit fc80bac into main Nov 3, 2022
@romainmenke romainmenke deleted the nesting-fix-pseudos-and-amp-everywhere--sincere-dhole-59a89f57aa branch November 3, 2022 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants