jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Make Icon Only Share Links Accessible

Open davidakennedy opened this issue 12 years ago • 4 comments

Currently, if a site owner uses the "Icon Only" sharing links, they are not accessible to screen readers.

Current markup:

<div class="sd-content">
  <ul>
    <li class="share-twitter">
      <a rel="nofollow" class="share-twitter sd-button share-icon no-text" href="http://mysite.com/2014/01/01/hello-world/?share=twitter&amp;nb=1" title="Click to share on Twitter" id="sharing-twitter-1"><span></span>
      </a></li>
    <li class="share-end"></li></ul></div>

Why?

  • These links use only icon fonts inside the <a>, but icon fonts are not announced by screen readers.
  • The title attribute may be intended for screen readers, but it's not announced by default by screen readers either, and it's really only useful for users with a mouse. See this post for more info on the title attribute.
  • When a screen reader announces these links, it says: "Link", which isn't descriptive and doesn't tell the user what the link does or where it goes.

Suggestions

Possible markup:

<div class="sd-content">
  <ul>
    <li class="share-twitter">
      <a rel="nofollow" class="share-twitter sd-button share-icon no-text" href="http://mysite.com/2014/01/01/hello-world/?share=twitter&amp;nb=1" title="Click to share on Twitter" id="sharing-twitter-1"><span class="screen-reader-text">Share on Twitter</span>
      </a></li>
    <li class="share-end"></li></ul></div>
  • Links should always have link text.
  • The screen-reader-text would be hidden off-screen, maintaining the design of these.
  • Also ideally, if the links open in a new window, it would warn them of that. Like: "Share on Twitter (opens in new window)"

Let me know if there are any questions. Also, happy to test a solution. :smile: Thanks!

davidakennedy avatar Aug 31 '14 02:08 davidakennedy

This may be a naive question, but if i may ask is there a strong reason for favouring screen reader text over putting an ARIA label on the link? I assume with the former we would have to style .screen-reader-text in sharing.css as it won't necessarily be in every theme.

chrisdc avatar Sep 02 '14 17:09 chrisdc

@chrisdc No, that's a great question. And you have a good point, it's a bit more work. The reason I usually prefer screen-reader-text is that it how better support in all assistive technology devices. ARIA support still varies here and there. It's kind of like browser support for new CSS stuff: good here, not so good there.

This post has a good comparison of text links, ARIA label and title attribute.

davidakennedy avatar Sep 04 '14 03:09 davidakennedy

Hi @davidakennedy Thank you for bringing this issue up. I have merged the pull request submitted by @chrisdc. The changes should be part of Jetpack 3.2 when it is released.

enejb avatar Sep 10 '14 20:09 enejb

@enejb and @chrisdc Thanks! This looks good!

davidakennedy avatar Sep 13 '14 21:09 davidakennedy