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

I'd like to point out that a `:has-assigned-content` pseudo-class (or better name) would be nice to have since:
* developers would like to avoid using JavaScript for what's basically a declarative effect;
* working around with `:host(:not(:empty)) slot` (for unnamed slots) or `:host(:has([slot='foo'])) slot[name='foo']`:
  * is verbose;
  * has content limitations (e.g. for components with multiple slots);
  * doesn't work for manual node assignment.

I'm quite keen myself to set a `display` value different than `contents` for slots, but this would also allow to style sibling or parent nodes (via `:has()`).

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


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

Received on Monday, 23 May 2022 10:53:09 UTC