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:

  1. Remove the ::before entirely, which means it will just be text
  2. Replace with a background image that can be ignored by the screenreader because from an audio-perspective the plus is decorative
  3. 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

Comments

rainbreaw created an issue. See original summary.

rainbreaw’s picture

Issue summary: View changes

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

andrewmacpherson’s picture

There's already an issue for this, I think.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Component: Seven theme » Claro theme
Issue tags: +Bug Smash Initiative

This 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.

mgifford’s picture

Issue tags: +wcag323

Sounds like SC 3.2.3 to me.

gauravvvv’s picture

Status: Active » Needs review
StatusFileSize
new2.24 KB

I have removed the + text from before, and have added a plus icon as background-image.
I have provided the patch, Please review.

varun verma’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.05 MB

I have applied #13 patch, Removed + text from before and added a plus icon as background image, its working properly attached screenshots,

xjm’s picture

StatusFileSize
new9.14 KB

I checked Olivero and confirmed that it does not have the + on Add Content and similar action buttons:
'Add content' button in the Olivero theme, with no '+' before the text

xjm’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs subsystem maintainer review

Claro 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:

/* Plus */
.action-link--icon-plus::before {
  content: "";
  background-image: url(../../images/icons/545560/plus.svg);
}

.action-link--icon-plus:hover::before {
  background-image: url(../../images/icons/0036b1/plus.svg);
}
.action-link--icon-plus:active::before {
  background-image: url(../../images/icons/002e9a/plus.svg);
}

Maybe we should be using that instead of adding a new SVG file? Maybe all that's needed is to remove the default ::before and/or expand the appropriate classes/styling to the default action button styling?

Tagging for Claro subsystem maintainer review to validate the approach.

gauravvvv’s picture

I am using the same icon, but in different color. Currently the plus svg color in .action-link--icon-plus is #545560. That was causing accessibility issue on #003ecc background color. That's why I created copy of above icon for #fff white color.

ckrina’s picture

Status: Needs review » Needs work
Issue tags: -Needs subsystem maintainer review

First, 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:

Base button styles.
These styles have been duplicated to dropbutton.css and action-links.css since those components inherits most of these design elements. Whenever making changes to this file, remember to check if that needs to be applied to dropbutton.css or action-links.css as well.

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 ::before element itself. From the suggested solutions, this has gone with a combination of 1 (remove ::before entirely) 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-....

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.