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

Add a selector equality check #228

Open
nex3 opened this issue Jul 20, 2020 · 0 comments
Open

Add a selector equality check #228

nex3 opened this issue Jul 20, 2020 · 0 comments

Comments

@nex3
Copy link
Contributor

nex3 commented Jul 20, 2020

One thing I would find very useful is the ability to check if two selectors are semantically equal. I'm currently comparing the string representations of selectors, but that doesn't capture the fact that (for example) :is(a, b) means the same thing as :is(b, a) or that [a=\-1] means the same thing as [a="-1"]. postcss-selector-parser notionally has enough information in its AST to make these comparisons, so it would be awesome if that logic was implemented and made available as an API.

For prior art, it may be useful to look at Dart Sass's AST and in particular implementations of the operator == and hash methods.

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

1 participant