Skip to content
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

title / description for accessible svg #116

Closed
DanielRuf opened this issue Jan 16, 2018 · 11 comments
Closed

title / description for accessible svg #116

DanielRuf opened this issue Jan 16, 2018 · 11 comments

Comments

@DanielRuf
Copy link
Contributor

DanielRuf commented Jan 16, 2018

Afaik we should use title/description as this is what most a11y testing tools like pa11y, Koa11y and so on are looking for.

https://css-tricks.com/accessible-svgs/

Also role="img", aria-hidden="true" and similar solutions might be needed in accessible projects.

@edent
Copy link
Owner

edent commented Jan 16, 2018

Our current accessibility guidance was kindly provided by @LJWatson in #50.

As per the article you listed - https://css-tricks.com/accessible-svgs/#article-header-id-11 - we use aria-label= as these are plain icons. If people want to use them in other contexts, they can use alt or title.

@DanielRuf
Copy link
Contributor Author

alt or title should not and can not be used when used as xhref and inline svg ;-)

Then we would need title / desc in the svg tag and role="img" or in some cases aria-hidden="true".

@DanielRuf
Copy link
Contributor Author

Well, at least the given guidance is not correct in most cases and misses some things.

I'm fine with this if this is documented with some examples somewhere or the CSS Tricks or anything else linked .

@edent
Copy link
Owner

edent commented Jan 16, 2018

OK - I'm very happy if you want to edit the README to include more accessibility information.

@LJWatson
Copy link
Contributor

The icons already use role="img".

The aria-label attribute and <title> element are different ways of providing an accessible name. Either can be used in this situation, but aria-label has the advantage of requiring less bytes to do it.

The advice to use alt (found on the README) is when the icon is pulled in using the <img> element, not for use with the SVG itself.

@DanielRuf
Copy link
Contributor Author

The aria-label attribute and <title> element are different ways of providing an accessible name.

Mh, is the browser support the same?

Thanks for the clarification.

Currently we test with pa11y / Koa11y.

@LJWatson
Copy link
Contributor

<Mh, is the browser support the same?<

With the exception of aria-label in IE, both methods are supported across all major browsers (Chrome, Edge, Firefox, IE (with the noted exception), and Safari).

@DanielRuf
Copy link
Contributor Author

So it may make sense that we stick to desc/title in svh elements as we also optimize for IE11.

@LJWatson
Copy link
Contributor

To be on the safe side, yes. It seems that Jaws and NVDA both have workarounds, meaning that the accessible name is announced even when it's applied using aria-label and viewed in IE11. Narrator doesn't seem to though.

@DanielRuf
Copy link
Contributor Author

To be on the safe side, yes. It seems that Jaws and NVDA both have workarounds, meaning that the accessible name is announced even when it's applied using aria-label and viewed in IE11. Narrator doesn't seem to though.

Interesting. Thanks for the information. Could be useful for our further testing. And thanks for taking the time give feedback on my proposal.

@edent should I keep the issue open and propose an update to the readme with the CSS Tricks article or what do you think?

@edent
Copy link
Owner

edent commented Jan 16, 2018

Yes, please update the README with clear guidance 😀

@edent edent closed this as completed Jan 28, 2018
romain-dartigues pushed a commit to romain-dartigues/SuperTinyIcons that referenced this issue Oct 4, 2019
Munazir151 pushed a commit to Munazir151/SuperTinyIcons that referenced this issue Oct 20, 2024
…m-refactoring

Medical website contact form refactoring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants