Re: [w3c/webcomponents] Custom pseudo-classes for host elements via shadow roots (:state) (#738)

I very much like the idea of a `:state()` pseudoclass selector for custom elements. I thought it up myself when thinking about the CSS WG discussion about classes for `::part()` pseudoelements—only to discover a link to here from there. Of course someone else thought of it first.

But the API I proposed in that thread is different from what's been discussed here: I suggest defining the state (as exposed to the outside) in terms of a selector that you test for a match (any match) inside the shadow tree.  That would avoid jumping down into mouseEnter and mouseLeave event handlers to recreate something like a `:hover` state.

Full comment: https://github.com/w3c/csswg-drafts/issues/3431#issuecomment-459995872


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/738#issuecomment-459996458

Received on Saturday, 2 February 2019 20:24:51 UTC