Change the way the + before the Add Content link is presented on admin/content so that NVDA on Firefox doesn't bury the link

Created on 29 September 2019, over 4 years ago
Updated 16 March 2023, over 1 year ago

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

🐛 Bug report
Status

Needs work

Version

10.1

Component
Claro 

Last updated about 4 hours ago

Created by

🇺🇸United States rainbreaw

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Gauravvv Delhi, India

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

  • Status changed to RTBC over 1 year ago
  • 🇮🇳India varun verma

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

  • 🇺🇸United States xjm

    I checked Olivero and confirmed that it does not have the + on Add Content and similar action buttons:

  • Status changed to Needs review over 1 year ago
  • 🇺🇸United States xjm

    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.

  • 🇮🇳India Gauravvv Delhi, India

    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.

  • Status changed to Needs work over 1 year ago
  • 🇪🇸Spain ckrina Barcelona

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

Production build 0.69.0 2024