pydata-sphinx-theme icon indicating copy to clipboard operation
pydata-sphinx-theme copied to clipboard

Fix violation of Axe rule link-name

Open gabalafou opened this issue 5 months ago • 3 comments

This PR is part of a set of fixes for issue #1428.

If you don't provide link-alt to Sphinx Design clickable cards, then:

  • The link may not appear in the list of links provided by assistive tech
  • It may not be presented by the assistive tech as a link to the user (in other words, a screen reader user may have to guess that the card is clickable)
  • Results in an Axe error: Links must have discernible text

link-alt was added to Sphinx Design specifically to address accessibility checkers.

In my opinion, it's not a perfect solution. For example, on our site, I had to duplicate the card text in link-alt because I didn't think any other value made sense. However, that means that not only is that text duplicated in the source code, it also ends up being duplicated for a screen reader too.

The cards probably need to be given an upstream re-think, but as this CSS Tricks article shows, getting clickable cards right isn't easy, so this solution will have to do for now.

gabalafou avatar Jan 06 '24 03:01 gabalafou