Increase the color contrast of the toggle button border

Created on 13 February 2025, 5 months ago

Problem/Motivation

The user interface component of the toggle button to expand or collapse the navigation sidebar is not clearly distinguishable as a button and might go unnoticed cuz the caret facing to the left for LTR also has a lower contrast against the background compared to the caret facing to the right for every top level menu item that contains sub menu items (See the table in
https://docs.google.com/spreadsheets/d/1won35PxhRFexJYE8FmZ4DCNTo7xEAxC8... or toggle_button.xlsx.zip β†’ for more details).


Discussed and iterated on the issue with @mgifford, @the_g_bomb, @katannshaw, and @drupa11y

Steps to reproduce

Proposed resolution

  • It is not necessarily a compliance issue with WCAG but it would still be good, for the reasons outlined in the problems section, to increase the color contrast of the button border to have a contrast of at least 3:1.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

4.0

Component

User interface

Created by

πŸ‡©πŸ‡ͺGermany rkoller NΓΌrnberg, Germany

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

  • Issue created by @rkoller
  • πŸ‡¨πŸ‡¦Canada mgifford Ottawa, Ontario

    The caret facing to the left is more or less invisible to most users I would think. It is too easy to miss as it isn't where folks are looking for this kind of a link.

  • πŸ‡¨πŸ‡¦Canada mgifford Ottawa, Ontario

    This isn't a Gin issue specifically.

  • πŸ‡¨πŸ‡¦Canada mgifford Ottawa, Ontario

    I think the menu module is the right place to do this.

    I don't know if this should be just for folks who have configured their browsers correctly, but we can start with them:

    @media (prefers-contrast: more), (forced-colors: active) {
    
      .admin-toolbar__expand-button {
        forced-color-adjust: none;
        background-color: ButtonFace !important;
        color: ButtonText !important;
        border: 4px solid ButtonText !important;
        box-shadow: none !important;
      }
    
      .admin-toolbar__expand-button:hover,
      .admin-toolbar__expand-button:focus-visible {
        background-color: Highlight !important;
        color: HighlightText !important;
        border-color: HighlightText !important;
        outline: 4px solid Highlight !important;
        outline-offset: 2px;
      }
    
      /* Make SVG chevron icon visible */
      .admin-toolbar__expand-button-chevron {
        fill: ButtonText !important;
        stroke: none !important;
      }
    }

    It would be interesting to see how that button features in user research. Certainly unsure how it would do with users who are using screen magnifiers.

  • πŸ‡©πŸ‡ͺGermany rkoller NΓΌrnberg, Germany

    that button is strictly speaking in the navigation module. i posted it in the gin queue as well due to the fact that there is a dark and light mode and navigation in core only has a light mode so far. that was the reasoning behind opening an issue in gin as well.

  • πŸ‡¨πŸ‡¦Canada mgifford Ottawa, Ontario

    I can move this to the navigation module.

    Is there a duplicate issue for this, or are you suggesting there should be another issue opened up?

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    In Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies β†’ . Thanks

Production build 0.71.5 2024