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

Condensing properties into a group #12

Closed Garbee closed 1 year ago

Garbee commented 2 years ago

Both auto* and delegates* attributes map to individual properties on the elements. I understand this is traditional and may just be something we don't want to push to change. However, the data-* attributes work in a very cool way that could be useful here if we want to clean up the API a bit. This would entail adding a dash in between the property key and the sub-property being targeted. Then the properties could all exist within one namespaced property on the element.

For example delegatesariaatomic would become delegates-ariaatomic and then map to a delegates property like so Element.delegates.ariaAtomic. Rinse and repeat.

Once again, unsure if this is something even considerable given how the data-* API is the only one to work this way and it was specifically designed to do this consolidation/namespacing. However, if we could get it that would be helpful in a few ways:

  1. Keep auto-complete helpers less cluttered in the global space for an element
  2. Iterating over just what a developer needs to go over, if a reason comes up, is more targeted
  3. It could help spot typos more easily since there is a separator making two shorter things to parse individually
mrego commented 1 year ago

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