::slotted and ::part
Opened this issue · 4 comments
::slotted(my-button::part(icon)) Error
::slotted(my-button)::part(icon) Error
Is this the way it is designed
What error? Could you provide an example?
What error? Could you provide an example?
example: https://github.com/vdapk/demo/blob/master/demo.html
I don’t know if it’s a design or a bug
::slotted(*::part(a))
is not correct, the part is not the slotted elements (a part is not an element at all actually since it can refer to multiple elements). So tweaking your example we have (let's pretend there's a <shadow>
element)
<my-group>
<shadow>
<style>
::slotted(*)::part(a) {
background:red;
}
</style>
<slot></slot>
</shadow>
# this goes in the slot
<my-button>Button
<shadow>
<div part="a">Text</div>
</shadow>
</my-button>
</my-group>
I would expect ::slotted(*)
to find <my-button>
and then ::part(a)
should find the div
.
So this seems like a bug to me. I don't work on this anymore. I have filed a chromium bug for this. The CSS team might point out some misunderstanding. If you have time, please check and edge, safari. Firefox seems to be the same as chrome.
::slotted(*::part(a))
is not correct, the part is not the slotted elements (a part is not an element at all actually since it can refer to multiple elements). So tweaking your example we have (let's pretend there's a<shadow>
element)<my-group> <shadow> <style> ::slotted(*)::part(a) { background:red; } </style> <slot></slot> </shadow> # this goes in the slot <my-button>Button <shadow> <div part="a">Text</div> </shadow> </my-button> </my-group>
I would expect
::slotted(*)
to find<my-button>
and then::part(a)
should find thediv
.So this seems like a bug to me. I don't work on this anymore. I have filed a chromium bug for this. The CSS team might point out some misunderstanding. If you have time, please check and edge, safari. Firefox seems to be the same as chrome.
thank