Problem/Motivation
When @cboyden's team did an assistive tech walkthrough of Media Library for #2834729: [META] Roadmap to stabilize Media Library using NVDA on Firefox, they found it difficult to locate the Add Content button when using the screenreader rotor (this is a tool that the screenreader user will pull up in order to just find one semantic type of content on the page, such as links or headers, in order to quickly navigate around).
Upon investigation, we found that the reason for the issue is that NVDA was including the + that is added in front of the text using ::before content in the CSS, which was burying the link and making it unreachable through expected search mechanisms.
View the impact of this issue
This behavior can be seen in action if you scroll ahead to minute 4:20 of the video recording of the September 26, 2019 walkthrough of Media Library.
The attached screenshot provides a marked-up snapshot of where this code is located.
Note that this problem is not present on VoiceOver in MacOSX, and I'm not sure if it has been tested in JAWS.
Proposed resolution
There are a few options:
- Remove the ::before entirely, which means it will just be text
- Replace with a background image that can be ignored by the screenreader because from an audio-perspective the plus is decorative
- Replace with an icon font that has proper naming/specifies blank alt text, and/or includes the presentation/aria-hidden roles
Remaining tasks
- Select the preferred resolution and adjust the theme to meet it.
- Suggest that Claro is also checked for the same concern.
User interface changes
Depending on which resolution is selected, the plus may be removed or replaced by an icon font.
API changes
None anticipated.
Data model changes
None anticipated.
Release notes snippet
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | Content___Drupal.png | 9.14 KB | xjm |
| #14 | Screenshot-after-3084554-13-patch.png | 1.05 MB | varun verma |
| #13 | 3084554-13.patch | 2.24 KB | gauravvvv |
| add-content_nvda.png | 406.05 KB | rainbreaw |
Comments
Comment #2
rainbreaw commentedComment #4
andrewmacpherson commentedThere's already an issue for this, I think.
Comment #11
quietone commentedThis was discussed in #bugsmash by myself and mstrelan to decided where to move it. They think this issue is still valid and exists in D10 themes. They suggested moving it to Claro and then once it was fixed the fix could be applied to starter kit. Therefor I am moving the issue.
Comment #12
mgiffordSounds like SC 3.2.3 to me.
Comment #13
gauravvvv commentedI have removed the + text from before, and have added a plus icon as background-image.
I have provided the patch, Please review.
Comment #14
varun verma commentedI have applied #13 patch, Removed + text from before and added a plus icon as background image, its working properly attached screenshots,
Comment #15
xjmI checked Olivero and confirmed that it does not have the

+on Add Content and similar action buttons:Comment #16
xjmClaro has an entire API function for adding icons to action links: _claro_convert_link_to_action_link()
It also already has SVGs for plus signs.
From
action-link.pcss.css:Maybe we should be using that instead of adding a new SVG file? Maybe all that's needed is to remove the default
::beforeand/or expand the appropriate classes/styling to the default action button styling?Tagging for Claro subsystem maintainer review to validate the approach.
Comment #17
gauravvvv commentedI am using the same icon, but in different color. Currently the plus svg color in
.action-link--icon-plusis#545560. That was causing accessibility issue on#003eccbackground color. That's why I created copy of above icon for#fffwhite color.Comment #18
ckrinaFirst, thanks all for the work here!
As @xjm mentions, there is an API to add icons in Claro shared across components that use icons. You can read the documentation on the file
button.pcss.css:So the strategy to change how icons are added can't be changed only for this single button, isolated from the rest of the components.
For what I understand from the issue summary, the main issue was using the "+" directly and not the
::beforeelement itself. From the suggested solutions, this has gone with a combination of 1 (remove::beforeentirely) and 2 (replace with a background image). I'd recommend going just with the suggestion from 2, since it's enough to solve the accessibility problem and will keep using the same strategy as the rest of elements using icons.Also, using the same icon as action links is the best option for now so we can reuse icons. Just remember to verify the icon respects the sizing defined for Medium button sizes in https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/%F0%9F%92%A7-Drupal-....