- From: Lea Verou via GitHub <sysbot+gh@w3.org>
- Date: Fri, 27 Sep 2024 21:38:54 +0000
- To: public-css-archive@w3.org
Talking about this with @rniwa today, he said the main implementation issue is targeting *other* elements (descendants, children, siblings, etc.). If we syntactically scope this combinator to only target the slotted element itself by disallowing other combinators after it (and certain pseudo-classes), that is perfectly implementable. I think this is still worth doing: - It fixes the pain point around specificity, because you are now targeting the slotted element itself, not a pseudo-element representing it - ✅ It fixes the issue with `querySelector()` - ✅ It gives us `:has-slotted()` with no additional syntax (`:has(/slotted/ *)`) - ✅ It gives us pseudo-elements and (most) pseudo-classes without any new syntax (closes #3896) - ✅ It opens up an upgrade path, so that if an implementor finds some clever way to implement the full syntax in the future, we have the syntax ready for it. While we _could_ fix all these in `::slotted()` theoretically, by piling more and more special syntax on top of it, this is a much more natural solution that involves way less weirdness and far better ergonomics. -- GitHub Notification of comment by LeaVerou Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7922#issuecomment-2380098440 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 27 September 2024 21:38:55 UTC