Problem/Motivation
In the context of the toolbar module, #3097907: Active toolbar tray has weak affordance and fails WCAG color criteria outlined the problems certain groups of people have to perceive the active toolbar tray. To a certain degree that problem applies to the navigation module as well, for certain groups of people and/or in certain contexts it is challenging to perceive which menu item is currently in the active state. There is no direct success criterion in the WCAG or any other spec I am aware of, the only recommendation I was able to find was in a tutorial for the W3C Web Accessibility Initiative (WAI) stating the following about the active state (https://www.w3.org/WAI/tutorials/menus/styling/#active-state):
Indicate the menu item that was activated through clicking, tapping, or keyboard selection. Users can identify unintended activation, for instance when they have clicked on the wrong menu item.
a) Top-level menu item in active state
How does a top level menu item in active state differ from those in none active state? There are two ways the difference is currently communicated:
| None active menu item | Active menu item | Color contrast | |
|---|---|---|---|
| Font color | #55565b (--admin-toolbar-color-gray-800) |
#002e9a (--admin-toolbar-color-blue-700) |
1.5:1 |
| Background color | #FFFFFF |
#f3f4f9 (--admin-toolbar-color-gray-050) |
1.1:1 |

Even though it seems that the active menu item label looks like using a bold typeface the font weight remains at 700, the same weight as menu items that are not in an active state. So basically the active state is communicated solely by color so SC1.4.1 applies, and due to the too low color contrast SC1.4.3 (for the font color) and SC1.4.11 (for the background-color) applies.
b) Top-level menu item in active state that is also added to the shortcuts
How does a submenu item in active state differ from those in none active state? There are two ways the difference is currently communicated:
| None active menu item | Active menu item | Color contrast | ||
|---|---|---|---|---|
| Font color | #55565b (--admin-toolbar-color-gray-800) |
#0036b1 (--admin-toolbar-color-blue-600) |
1.3:1 |
|
| blue dot | #FFFFFF |
#002E9A |
11.3:1 |

Compared to the top-level menu items sub menu items aren't using a change of the background color to label the active menu item, instead a blue dot is used which is good. In regards of the text color there is the same problem of the same low color contrast (ref SC 1.4.3) that was already noted for top-level menu items.
c) Sub-menu menu item in active
There is one additional special third case. In the event of that a top-level menu item becomes active that is also added as a shortcut, the shortcuts group autoexpands using the pattern described in b) while the top-level menu item gets shown as active as well. That way you have two active menu items at the same time.

Strictly speaking probably correct but still a little bit confusing since the label for the top-level menu item in the current example is Content while the label for the shortcut is All content plus having two active elements at once is a source of potential confusion
Steps to reproduce
- Go to
/admin/appearance - Go to
/admin/structure/display-modes/form - Go to
/admin/content
Proposed resolution
Update the current styles with the new designs:

Link to the designs on Figma.
User interface changes
The active state for the Navigation items will change.
Before:

After:

| Comment | File | Size | Author |
|---|---|---|---|
| #28 | issue-3426468-28-annotated-design-image.png | 82.31 KB | kentr |
| #26 | 3426468-26-case-a-top-level-menu-item.png | 18.93 KB | kentr |
| #26 | 3426468-26-case-b-submenu-submenu-item-in-shortcuts.png | 44.63 KB | kentr |
| #26 | 3426468-26-case-c-top-level-menu-item-in-shortcuts.png | 49.75 KB | kentr |
| #23 | sublevel-active-menu-dot-after-patch.png | 574.1 KB | nayana_mvr |
Issue fork drupal-3426468
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
Comment #2
rkollerComment #3
mgiffordThanks @rkoller. Thanks for documenting this all. It would be great to help make it easier to identify what elements are active. We can make this easier for everyone to identify.
Comment #4
ckrinaHi @rkoller. First of all thank you for taking the time to work on this! We're working on a new design system that will change colors and, more important, states. More info in #3426606: [META] Implement the final design system.
So I am postponing this until that one is ready. Sorry for not communicating this work in progress properly sooner! It's been complicated to coordinate all the moving parts to have them ready on time.
Comment #5
KeyboardCowboyWe'd like to review this against the new designs that are currently implemented as part of the Drawer system.
Comment #6
ckrinaComment #7
ckrinaDesigns have been updated to comply with the accessibility requirements. Updating the issue summary accordingly.
Comment #10
gauravvvv commentedComment #12
mithun sCurrently #00389a is used as (-admin-toolbar-color-blue-650) and #002566 is used as ( --admin-toolbar-color-blue-700). Hence introduced a new variable (--admin-toolbar-color-blue-670) for #002e9a and used the variables on css files. Please suggest if the variable name is good. If any changes that would be required, am happy to update the same.
Thank you!
Comment #13
ahsannazir commentedThe hover styles on submenu child items are not as per the design shared above. Attaching sccreencapture
Comment #14
ahsannazir commentedComment #15
ahsannazir commentedComment #16
dishakatariya commentedComment #17
dishakatariya commentedComment #18
finnsky commentedI've added couple of feedbacks
Comment #19
ahsannazir commentedComment #20
ckrinaThis is a visual change, please add before and after screenshots so we can compare and see the results.
Comment #21
smustgrave commentedper #20.
before/after should go into the user interface section of the summary.
Comment #22
ahsannazir commentedComment #23
nayana_mvr commentedI just checked the latest changes in the MR8446. Changes are applied cleanly but I think there are more updates required. For eg., the Content menu font color in active state is still not updated. I think the current font color changes are not getting applied to menus such as Blocks, Content, Files and Help. Also, on hovering the menu the outline color is changing but font color remains the same. I'm attaching few screenshots which shows the color code also in the styles for reference. As I'm unable to access the Figma design dev mode, I couldn't verify the exact color codes.
Comment #25
catchThis is listed on #3391723: [PLAN] Accessibility review for new Navigation bar but there hasn't been an update here for 18 months. Often the answer to 'is this still relevant' on core issues is 'unfortunately yes' but given there's been a lot of change in Navigation in the past 18 months, it feels worth checking whether this was affected by other changes in the meantime?
Comment #26
kentr commentedThe colors and menu layout have changed, but it looks like the underlying issue is still relevant.
Here are some screenshots of the three cases on
11.x.I think the titles for case b) and c) in the IS are swapped, so I ordered these based on the case descriptions.
that is also added to the shortcuts:I'll give the MR a go.
Comment #27
kentr commentedWorking on rebasing & incorporating changes into current styles.
Comment #28
kentr commentedOn second thought, I think it would be better to create a new MR. There are rebase conflicts, and I'm not sure that the current MR is the right approach.
To me it looks like the design specifies dark gray dots to the left of the active item. Here's a screenshot of the Toolbar Menu Items slide on the Figma page linked from the IS, with the dots highlighted by the arrows.
The dot is currently present for active "grandchild" items, but not for items at higher levels. Example grandchild: Structure > Display modes > View modes
So I'd say that to match the design, the change for this needs to include the dot and the color of the active menu item text and icon. Looks like color change would be
--toolbar-button-current-color: var(--admin-toolbar-color-gray-990);.It looks like the active item background color matches the design. With a color picker on the design file, I get
#f3f5f9, same as what I see in devtools (for-admin-toolbar-color-gray-050).The hover colors don't currently match the design, but I question whether they need to change in order to make the active item stand out more. I defer to the accessibility gurus on this.
Comment #29
mgiffordIn a meeting on accessibility and Navigation with Mike Herchel, Ralf Koller & Kat Shaw we discussed this issue and decided that this was a best practice that we should implement, but not currently breaking a WCAG 2.2 AA SC. We do hope that more can be done to address this. There was support for the ideas that @kentr is highlighting here.