cables-gl / cables_docs

cables documentation docs.cables.gl
https://cables.gl/docs/docs
46 stars 16 forks source link

Accessibility: Make aria-hidden for the canvas a patch setting. #929

Open TobyKLight opened 1 week ago

TobyKLight commented 1 week ago

Request is to have a checkbox in patch settings that allows you to mark your \<canvas> with the aria-hidden attribute.

Usecase is when your canvas is entirely decorative (e.g background of a website that does not contribute to content) and should not be announced by assistive technology.

More info on aria-hidden

pandrr commented 6 days ago
Screenshot 2024-11-28 at 09 27 08

we now have this accessibility op on dev.cables.gl which can set alt and aria-hidden for any html element. could there more properties added ? let me know!

pandrr commented 6 days ago

should this op also have a role parameter ?

what about aria-label ?

TobyKLight commented 4 days ago

These were the accessibility properties I needed to make UIs so far on HTML, that I put on the HTMLElementExtended op.

Note the HTMLElementExtended op allows you to set any tag as well so you can make

TobyKLight commented 4 days ago

Note also with the ElementAccessibility op as it is currently: only \<img> elements support the alt attribute. Better I think to just add alt as a property to the ImageElement op.

aria-label and aria-labelledby attributes are the way to provide alt text for most element types. (But not all... See the MDN article for details)

pandrr commented 2 days ago

btw. there is now a elementSetAttribute operator, which can be used to set all those aria attributes

pandrr commented 2 days ago

hey, maybe you could take the current Ops.Html.ElementAccessibility op and add your accessibility stuff to it ?

pull request highly appreciated :)