-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Aria-label for links #23972
Comments
I think the idea is that you shouldn't need an aria-label if the text in the button/link is clear, but I've added the |
Yes, when link has text that exactly described it, aria-label isn't needed, but if it is a button with text like "Learn more" - aria-label required. Thank you |
The accessibility team has decided on the Friday accessibility team meeting that this may not be the best solution. Our recommendation is to close this issue out and maybe head in the direction of #22332. Slack archives link: https://wordpress.slack.com/archives/C02RP4X03/p1598023411125200. Thanks. |
@alexstine did the team take buttons with only an icon (inline image) into account? |
@asafm7 I think CC @afercia for his thoughts on this subject. Thanks. |
Thanks @alexstine I understand what you are saying, but the web is dynamic, and sometimes icons help. In some cases, icons can even be better and more understandable than text (icons, for example, are less language-dependent, and this sense might even be more accessible than text). When icons are used, it would be good to be able to make them accessible. In my case, I use the Buttons block inside a Navigation block, for some of the navigation links - mostly to save space. I place inline images (icons) inside buttons, for example for a wishlist page and home page links. In the absence of other accessibility options, I add text below the icons and set the font size to 0. I don't feel like it's a solid solution. |
@asafm7 Can you explain what you mean? Are you saying instead of "Add to wish list" you just have an icon? I would argue that icons are extremely subjective as it's an issue we've faced in Gutenberg back-end. I would assume most people would associate a "heart" icon as a favorite action but I think it's a crazy argument to make that icons could make more sense then text. The problem with using One of my classic annoyances is when developers think this is okay for submenu triggers. If you were using voice commands, would you know to speak "About submenu" just because there was a ⬇️ icon present? If for some reason, the accessible name was only "About" and the submenu had Playing devil's advocate, most modern browsers can translate pages today. I'm not saying that's perfect by any means but at the same time, you can't find one browser out there that dynamically fixes accessibility problems. Even if you could, accessibility is a guess for AI, language translation is language translation, based in fact. Language translation in this point in time is easier. I hate to split hairs on inclusion but I think the argument for accessibility in this point in time is still a little stronger. My disability makes me quite bias though, we'll see if others wish to chime in. Thanks. |
Thanks @alexstine In this case, I was referring to a navigation link to a wishlist page. You can check it here:
In some cases, I don't think it is such a crazy argument. Icons, and symbolism, can be a powerful and efficient way to communicate. As I mentioned before, one advantage is icons not being language-dependent. Also, in some cases, icons might communicate a message faster than text. Road signs make use of these two facts. (after all, letters are symbols. In some languages, you can easily trace the symbolic origin of a letter being an "eye" or a "bull"). Of course, icons are not bulletproof, but neither is written text. And anyway, one needs to be able to see the icon, and see it clearly, to make use of it. Not everyone can, and that's what we are trying to help with. If I understand you correctly, you say that icons should never be used for communication. For this reason, we shouldn't provide means of making icons accessible. Maybe even hoping that without the means for accessibility, people will be discouraged from using icons. But in many cases, people will keep using icons (sometimes for good reasons). As you said, it is a fight that can never be won. I believe that not giving people the means of making icons accessible might hurt the accessibility cause rather than help it. Let me know if I misunderstood you or missed anything. How well people communicate is up to them. But we can at least give them the tools to do so. In my case, I believe that adding a "wishlist" aria-label to an icon navigation link (inside a Actually, in this case, besides an aria-label, a "title" HTML attribute can help remove possible uncertainties for people without seeing disabilities by hovering over the icon, and without having to click it. This makes me think that maybe a more robust solution will be the ability to add any custom HTML attributes (Elementor has such a feature). I'm not sure I followed your submenu example as it is quite late for me. But I will return to it tomorrow, as it is important for me to understand. Submenus can be quite ambiguous and confusing for people without disabilities as well. I remember reading this article a while ago: |
We shouldn't add an And, overall, it's better to use screen-reader accessible hidden text in a case like this, as it will provide a label even if CSS fails to load. That's a rare case, but it's not impossible. @asafm7 What is your mechanism for adding icons to links that doesn't allow you to provide them with an accessible name of their own? |
Thanks, @joedolson. The mechanism is an Inline image inside a Button block (inside a Navigation block). |
Add editable aria-label field for links and buttons.
I think, it should be like "rel" field in the link settings.
The text was updated successfully, but these errors were encountered: