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

the footer navigation block in the navigation sidebar in light mode illustrating the toggle button
the footer navigation block in the navigation sidebar in darkmode illustrating the toggle button

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

Issue fork drupal-3506321

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rkoller created an issue. See original summary.

mgifford’s picture

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.

mgifford’s picture

Project: Gin Admin Theme » Drupal core
Version: 4.0.2 » 11.2.x-dev
Component: User interface » ajax system

This isn't a Gin issue specifically.

mgifford’s picture

Component: ajax system » menu.module

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.

rkoller’s picture

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.

mgifford’s picture

Component: menu.module » navigation.module

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?

quietone’s picture

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

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

libbna’s picture

Assigned: Unassigned » libbna
StatusFileSize
new169.62 KB
new196.56 KB

Hi,
I checked and compared the colors of both carets. The right caret has a color of #4F5661, which gives a contrast ratio of 7.4:1, while the left caret uses #8590A3, resulting in a lower contrast ratio of 3.22:1.

Just to confirm — would you like me to update the left caret to use the same color as the right (#4F5661) for consistency and better contrast? Please confirm so I can proceed accordingly.

I used the WebAIM Contrast Checker to verify the ratios.

mgifford’s picture

Yes. That sounds right to me. Using the same color would make it easier to identify. Thanks.

libbna’s picture

Cool. Thanks for confirming. I am working on it.

libbna’s picture

Status: Active » Needs review
StatusFileSize
new11.34 KB
new11.72 KB

I have changed the color of the arrow of toggle button to increase the contrast.

sdhruvi5142’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new17.85 KB
new94.47 KB

Hi, I've applied MR!12375 and verfied the changes and they are working as expected.

Testing Steps:
1. Enabled Navigation Module
2. Check the Toggle button color in left drawer
3. Observe the changes there.

Testing Result:
The color of both the toggles look same and the color contrast also got increases. Attaching screenshots fore reference. Can move this to RTBC+1

Status : PASS

nod_ made their first commit to this issue’s fork.

nod_’s picture

ckrina’s picture

The slight color change in the arrow is OK on a visual perspective.

  • nod_ committed 9271a55f on 11.2.x
    Issue #3506321 by libbna, rkoller, sdhruvi5142, mgifford, ckrina:...
nod_’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed d6f8e99c4cd to 11.x and 9271a55faa8 to 11.2.x. Thanks!

  • nod_ committed d6f8e99c on 11.x
    Issue #3506321 by libbna, rkoller, sdhruvi5142, mgifford, ckrina:...
nod_’s picture

Version: 11.x-dev » 11.2.x-dev
libbna’s picture

Assigned: libbna » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.