- From: Luis Pato <notifications@github.com>
- Date: Thu, 18 Jan 2024 00:10:47 -0800
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 18 January 2024 08:10:54 UTC
I think ::part() is nice and works well, but for big / composed WCs it can be cumbersome to expose and document parts for every element inside a component.
So what if there would be something like a `::part-with-descendents` which would allow us to expose an element of the WC **including its children**.
For instance:
```html
<ul class="list" part-with-descendents="amazing-list">
<li class="list__item">This in an item</li>
<li class="list__item">This in another item <span class="list__banana">with something special</span></li>
</ul>
```
And then:
```css
cool-component::part(amazing-list) {
border: 1px solid red;
}
cool-component::part(amazing-list .list__item) {
color: tomato;
}
cool-component::part(amazing-list .list__banana) {
text-transform: yellow;
}
```
This would allow the WC author to expose whole sections of the component, or maybe even the whole component if they want to.
--
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/986#issuecomment-1897990784
You are receiving this because you are subscribed to this thread.
Message ID: <WICG/webcomponents/issues/986/1897990784@github.com>
Received on Thursday, 18 January 2024 08:10:54 UTC