This proposal from @leaverou looks really interesting 👀
Now that we have `:has()` it should be possible to create `inverted` combinators.
A new parent combinator `B < A` could be syntactic sugar for `A:has(> B)`. Similarly we could add previous sibling and ancestor combinators.
The symmetry could make it easier for students to learn, and it could improve readability.
Child selector: `A > B`
Parent selector: `B < A`
What do you think?
Go check it out:
github.com/w3c/csswg-drafts/is…
[selectors] Backwards combinators
Combinators that could go "backwards" have been proposed before, but until :has() they were rejected on the basis of feasibility. However, now that we have :has(), they are merely syntactic sugar: ...LeaVerou (GitHub)
verita84
in reply to Johannes Odland • • •