There is some discussion in Drupal 8 core about adding aria-current="page" to the current active menu link:
- #2893640: Modernize ARIA usage, in line with ARIA 1.1 and the ARIA Authoring Practices guide.
- #3038523: Add aria-current attribute to navigation items
- #3089689: Use aria-current="page" to indicate active link in menus
This would be a good accessibility improvement to get into D7 themes. Patch forthcoming.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | interdiff.txt | 1.15 KB | dsnopek |
| #5 | radix-aria-current-3109601-5.patch | 2.16 KB | dsnopek |
Comments
Comment #2
cboyden commentedHere's a patch that adds the attribute.
Comment #3
dsnopekBased on the info in the referenced issues, it sounds like the internet is heading in the direction of using this and that Drupal 8/9 is gonna follow that path too. And, I trust @cboyden when it comes to accessibility best practices. :-)
The change is simple and non-intrusive - let's do it!
However, when I tested the patch, everything worked, but it doesn't appear to handle tabs like View, Edit, etc. Is that intentional or was it overlooked?
Comment #4
cboyden commented@dsnopek I've added an implementation of theme_menu_local_task() to the patch - this is the code that you proposed for a child theme, but I've relied on aria-current without any invisible text, which would add verbosity and is probably not needed.
Comment #5
dsnopekThanks, that worked in my testing! Here's a patch that cleans/simplifies the new code a little bit.
Comment #7
dsnopekCommitted!