Monday, June 3, 2019

Do you need an ICON ONLY button without screwing up the accessibility?

The first consideration is: do you really? If you can, having text next to your icons is proven over and over again to be the most accessible and clearest UX (see Apple's latest blunder). But if you need to (and I get it, sometimes you need to), Sara Soueidan and Scott O'Hara have a pair of articles that nicely lay out all the options and present actual research on this topic.

If you just want to be told what to do, I'd go for the just use some text in the button approach:

<button aria-expanded="false" id="menu-trigger">
   <svg viewBox="0 0 32 32" width="32px" height="32px" 
     aria-hidden="true" focusable="false">
     <!-- svg content -->
    </svg>
    Menu
</button>

Sara says There is no One Way to Rule Them All, but it does seem like you really need to use actual text inside that button and either hide it or override it somehow. SVG alone has no rock solid way to provide an accessible name to a button or link.

Funny how long this has been a tricky pattern to get right.

The post Do you need an ICON ONLY button without screwing up the accessibility? appeared first on CSS-Tricks.

from CSS-Tricks https://css-tricks.com/do-you-need-an-icon-only-button-without-screwing-up-the-accessibility/

Do you need an ICON ONLY button without screwing up the accessibility? was first published to http://www.instant-web-site-tools/



source https://www.instant-web-site-tools.com/2019/06/03/do-you-need-an-icon-only-button-without-screwing-up-the-accessibility/

No comments:

Post a Comment

40+ Best Minimal Logo Design Templates

Minimalist logo design is an art. How can you convey your brand with a professional logo, but keep the simplicity of a minimal, clean, and s...