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

Support for relational pseudo-class :has() #66

Open
redapple opened this issue Nov 23, 2016 · 0 comments
Open

Support for relational pseudo-class :has() #66

redapple opened this issue Nov 23, 2016 · 0 comments

Comments

@redapple
Copy link
Contributor

redapple commented Nov 23, 2016

CSS Selectors Level 4 (still in draft) introduce the :has() pseudo-class:

The relational pseudo-class, :has(), is a functional pseudo-class taking a relative selector list as an argument. It represents an element if any of the relative selectors, when absolutized and evaluated with the element as the :scope elements, would match at least one element.

For example, the following selector matches only <a> elements that contain an <img> child:
a:has(> img)
The following selector matches a <dt> element immediately followed by another <dt> element:
dt:has(+ dt)

Although no browser seems to be supporting this yet, it looks here to stay (I may be wrong).

It would be interesting to support this to get a bit more flexibility on predicates (e.g. testing children elements).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant