-
Notifications
You must be signed in to change notification settings - Fork 0
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
Shadow parts #9
Comments
Feels like this requires a deeper understanding of the element you are consuming, whereas the current approach simply says “this element gives me this” without needing to know how. How would something like this work in a declarative fashion? JS-first and JS-only solutions should be non-starters. Part is an interesting marking API, however. Maybe there’s a benefit to using that as opposed to |
This makes sense to me. By leveraging E.g. for delegation: <x-input aria-label="My label">
<template shadowroot="open" delegates-aria-label="foo">
<input type="text" part="foo">
</template>
</x-input> And reflection: <x-label id="bar">
<template shadowroot="open" reflects-aria-labelledby="foo">
<label part="foo">My label</label>
</template>
</x-label>
<input type=text aria-labelledby="bar"> This is elegant since, if a |
I don't think we want to reuse
|
I've create an issue about this in the other repo, as I'm trying to discuss both problems together in the other repo and then we could decide what to do. I've some ideas at https://github.com/leobalter/cross-root-aria-delegation/blob/main/explainer.md#2-export-elements, but yeah probably we need to discuss about the right proposal. I'd suggest moving this discussion to issue leobalter#23. |
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. LikeThen 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.The text was updated successfully, but these errors were encountered: