Skip to content

postcss-is-pseudo-class : fix :not pseudo interaction #828

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

romainmenke
Copy link
Member

fixes : #827

:not(is(a, b, c)) can not be rewritten as a forgiving selector.
It is either the wrong selector (current behavior) or an unforgiving list (new behavior).


The only reason to split all these selectors so aggressively is to be a 100% sure that every rule will be valid or invalid individually.

But we actually know for a lot of these that they will always be valid.
Only new pseudo's, nesting or unknown combinators can trigger invalid selectors.
To be super cautious I also included case insensitive attribute matching.

We can tweak the logic as needed.

@romainmenke romainmenke changed the title postcss-is-pseudo-class : fix not pseudo interaction postcss-is-pseudo-class : fix :not pseudo interaction Feb 1, 2023
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! Thanks for doing this!

@romainmenke romainmenke merged commit e2063ba into main Feb 2, 2023
@romainmenke romainmenke deleted the postcss-is-pseudo-class--fix-not--practical-albatross-2f08526ec2 branch February 2, 2023 07:06
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.

[postcss-is-pseudo-class] :not(:is()) producing incorrect CSS
2 participants