Skip to content

Shadow parts #9

Description

@mrego

Talking to @emilio about this topic, he suggested that this is quite similar to what Shadow parts do: https://w3c.github.io/csswg-drafts/css-shadow-parts-1/

With shadow parts you mark with part attribute and element you want to style from the outside. Like

<x-label id="customlabel">
  #shadow-root
    <label part="aria-labelledby">My custom label</label>
</x-label>

Then you can style that with ::part(aria-labelledby).

There are no JS API right now, but if you could do something like customlabel.part("aria-labelledby") that would expose that element and allow referencing it from the outside, maybe that could be a solution we can re-use for this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions