:has has been a part of jquery for forever. XPath has axis which allows similar expressive powers.
As noted elsewhere in the comments, this has been long (a decade plus) planned for "some future CSS" by editors and contributors. It didn't make the cut for selectors level 3 for reasons discussed in other comments here. It is currently part of 4 in potentially modified (and less powerful) form.
Personally, I find myself wanting it all the time. I frequently find myself littering HTML with (otherwise nonsensical) classes to achieve the sorts of things that this makes easy.
Comments
:has has been a part of jquery for forever. XPath has axis which allows similar expressive powers.
As noted elsewhere in the comments, this has been long (a decade plus) planned for "some future CSS" by editors and contributors. It didn't make the cut for selectors level 3 for reasons discussed in other comments here. It is currently part of 4 in potentially modified (and less powerful) form.
Personally, I find myself wanting it all the time. I frequently find myself littering HTML with (otherwise nonsensical) classes to achieve the sorts of things that this makes easy.