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

Not pseudo takes selector #152

Merged
merged 4 commits into from Mar 6, 2018
Merged

Conversation

sebastiaanvisser
Copy link
Owner

The :not() pseudo selector now takes a Selector as argument, not a Text. This is closer to the CSS semantics and allows reuse of Clay selector syntax.

Note that this change will break the API and needs a bump. You can still just use string literals as arguments with OverloadedStrings, so the impact is likely very limited.

Additionally I made a small fix in the selector parser by reusing the refinement parser internally. This means now things like ":first-child" and "@data-foo" will parse properly. (using with star internally).

Not super relevant for now, but PseudoFunc is modelled to always take Text arguments, which is somewhat weakly typed and requires the :not() selector to convert to text immediately. Better model the actual function arguments types (e.g. Text | xn+k | Selector) to allow future inspection / optimizations etc, but I'm pretty sure no one is relying on that any time soon.

@seanparsons seanparsons merged commit f87bfa6 into master Mar 6, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants