-
Notifications
You must be signed in to change notification settings - Fork 6
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
a11y improvements #32
Comments
Hi! I can't provide code at the moment but here's a link to explain the various options for accessible icons: https://css-tricks.com/accessible-svg-icons/ TL;DR: it depends. The long version:
The simplest implementation for the library would be to just add Another (slightly costlier) option would be to accept an alt parameter, and inject it as a title tag if it's present, or add the ARIA hidden attribute if it's empty or nil. Additionally, adding a title attribute is usually helpful for icon-only links and buttons, because sometimes icon designs can be unclear, ambiguous, or simply fail to load. Because accessibility is not only about blind users but also visually impaired, and mental issues, and temporary conditions: headache, cracked screen... |
Thanks for the insights, @goulvench. Would like to move this forward some how. It's tricky. There's nothing that can be added to Rails Icons to “make it work” (not sure if adding Thinking of these changes as a starting point:
Any expert who wants to chime in too? |
The simplest solution would be to just add the aria attribute, add a warning in the documentation, and move on, because ultimately it's the developer's job to add text or an aria-label in the right place, which is outside the scope of this gem. The title option is more cumbersome, as the icon may already have a title tag, which could need to be overwritten or left as is. |
Closing this per comments above. ☝ If you read this, feel free to add your comments or suggestions if you have any professional insights. |
I am wondering if there are attributes that can be added by default that would improve a11y?
The text was updated successfully, but these errors were encountered: