leobalter / cross-root-aria-delegation

Explainer for the Cross-root ARIA delegation proposal
https://leobalter.github.io/cross-root-aria-delegation/
25 stars 3 forks source link

[Declarative Shadow DOM] bikeshedding delegates attributes #3

Closed bennypowers closed 1 year ago

bennypowers commented 2 years ago

I'd like to suggest that instead of

<span id="foo">Description!</span>
<x-foo aria-label="Hello!" aria-describedby="foo">
  <template shadowroot="open" shadowrootdelegatesarialabel shadowrootdelegatesariadescribedby>
    <input id="input" autoarialabel autoariadescribedby />
    <span autoarialabel>Another target</span>
  </template>
</x-foo>

We have

<span id="foo">Description!</span>
<x-foo aria-label="Hello!" aria-describedby="foo">
  <template shadowroot="open" delegates="arialabel,ariadescribedby">
    <input id="input" auto="arialabel,ariadescribedby" />
    <span auto="arialabel">Another target</span>
  </template>
</x-foo>

alternatively, instead of auto="..." within the shadow root, perhaps we could have

<input delgationtarget="arialabel,ariadescribedby">
leobalter commented 2 years ago

Thank you! I like the suggestion on the delegates="" and we can discuss this in the roll for declarative shadow DOM.

For the auto="" I'd say we can hold on a bit as the current autoaria* are known as the "have consensus" format to move this proposal forward.

chrisdholt commented 2 years ago

I love seeing this explainer come together, thanks @leobalter!

This may be worthy of an issue of its own, but I'm curious if there is any thought around being able to shorthand delegate all global ARIA attributes? A specific example is a design system where instead of recreating button, we want to simply delegate focus to a button in the shadow root. It seems like we'd need to enumerate all potential attributes being enumerated above and I'm curious if you think it would be worthwhile to have a method to delegating all global attributes from the ARIA Mixin. As the custom control work from Open UI gains ground, I could see more and more folks moving towards using platform controls but still wanting to deliver their design system via WC's.

mrego commented 1 year ago

The updated explainer is trying to move on these lines, maybe we can find better names for all this, but we at last no longer have one property per ARIA attribute.

mrego commented 1 year ago

As there are a bunch of similar issues related to syntax, let's discuss them all together at #22.