-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
created page for :has-slotted and links to reference it #36865
created page for :has-slotted and links to reference it #36865
Conversation
Preview URLs
(comment last updated: 2024-12-02 14:33:54) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks :)
I have a suggestion, still. It took me a while to wrap my head around the example with all templating and slotting. Since it’s a CSS selector, I wonder if we can simplify the demo, even though it would be less practical. I think it’s fine for a reference page. Something like this, maybe?
<p>
<template shadowrootmode="open">
<style>
:has-slotted {
color: tomato;
}
</style>
<slot name="one">Placeholder 1</slot>
<slot name="two">Placeholder 2</slot>
</template>
<span slot="one">Slotted content</span>
</p>
I have added this simple example and also left in the original example. |
I believe the issue affects only the preview. It should be fine in production. So I’d uncomment examples. They should be fine. As for the complex example, would it be better to have it somewhere in the web components guides/references? I’m concerned that it involves so many APIs that it would be hard to fully understand the |
I shall remove this then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I hope you can find a use for your example. It’s a good one :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please avoid the term "simple"; it may not be simple for someone.
Only one example, so your removing suggestion is better than my update suggestion. I avoid using "simple" in all forms as much as possible because of the issue mentioned above but also because it is a term used in some specs. For example, "simple selector". When needed, though, I try to work in "simpler" instead of "simple". In this case, basic is best because it is a basic example whereas simpler would mean there is a more complex example that this example is simpler than. (it's way too early for me to be working so apologies if i make little sense) |
Co-authored-by: Estelle Weyl <[email protected]>
Co-authored-by: Vadim Makeev <[email protected]>
Description
:has-slotted
<template>
HTML element<slot>
HTML element::slotted
CSS pseudo-elementMotivation
Related issues and pull requests