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

@trusktr 
> Will :has-slotted match when the slot forwards to another deeper slot? We will need a way to distinguish slots with finally slotted content vs slots with content that is being forwarded to a deep slot.

Could you provide an example of that? I didn't think about the distinction, so I'm not sure.

--------

@justinfagnani 
> I think you have to reproduce this behavior. An important aspect to consistency is fallback content. A whitespace text node will prevent fallback content from showing. I don't think we want :has-slotted to disagree with fallback.

Agree, tho I agree with Lea that it sucks. But yeah, I believe the major use-case of `:has-slotted` is giving it different styling based on whether the fallback is showing or not, so it needs to be consistent. Ideally we should be able to specify that a slot needs *elements* (or at least significant text) so it'll be fixed in all the relevant APIs at once.

In the absence of that, I think @sorvell's idea of `:has-slotted-empty` has merit; it's a patch, but it's simple.

--------

re: functional form, agreed with Lea. The resolution was for the non-functional form. We can pursue the functional form *as well*, but it can be done separately; CSS is fine with handling a pseudo with both forms.

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


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

Received on Monday, 23 September 2024 17:49:00 UTC