Re: [csswg-drafts] [selectors] Pseudo-class to indicate when a slot has content (#6867)

Non-functional `::slotted` would make no sense: what is it targeting? Non-functional `:has-slotted` not only makes sense, it has its own, distinct use cases. Moreover, both in my and @claviska’s experience building custom elements, the vast majority of use cases we've come across simply required knowing if any nodes were assigned to the slot at all, whether text nodes or anything else. These were also the use cases @plinss opened this issue for.

----

@claviska also reminded me of a potential footgun here: does a single whitespace text node match `:has-slotted`? It does become slotted, but that’s a footgun in the current design, see https://x.com/LeaVerou/status/1785904086929346957
Do we reproduce this footgun or break [consistency](https://www.w3.org/TR/design-principles/#consistency)?

-- 
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6867#issuecomment-2364640761 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 20 September 2024 21:27:50 UTC