Problem/Motivation

In dark mode, the action buttons in the toolbar bar have too low contrast (2.88:1).

The contrast should be at least 3:1.

WCAG SC 1.4.11 Non-text Contrast (Level AA).

Screenshot of toolbar at URL /user/1 in Default Admin theme dark mode.

Steps to reproduce

  1. Do a standard installation.
  2. Set the admin theme to Default Admin.
  3. Go to /admin/appearance/settings/default_admin.
  4. Choose Dark for the Appearance setting.
  5. Click the Save configuration button.
  6. Go to /user/1.
  7. Observe the Edit button at the top-right of the page.

Proposed resolution

Use a different color, such as the same color as the standard form submit buttons: --admin-color-primary.

Looks like other toolbar styles for Default Admin are in core/themes/default_admin/css/layout/top-bar.pcss.css

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#9 after.png72.18 KBf0ns
#9 before.png69.81 KBf0ns
Screenshot 2026-08-19 at 9.25.58 AM.png32.97 KBkentr

Issue fork drupal-3618127

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

kentr created an issue. See original summary.

mherchel’s picture

Verified this is still an issue.

We can override this in Default Admin (like we do with the toolbar), but ideally all of these styles will be moved into the Toolbar module once #3606655: Make dark mode a first class citizen of Drupal core is in

mherchel’s picture

Issue tags: +CSS
kentr’s picture

Title: Toolbar action buttons in dark mode have low color contrast » Navigation top bar action buttons in dark mode have low color contrast

ideally all of these styles will be moved into the Toolbar module

I called it the "toolbar" because that's in the filename / selectors, but the current styling is in the Navigation module (core/modules/navigation/components/toolbar-button/toolbar-button.css).

mherchel changed the visibility of the branch 3618127-navigation-top-bar to hidden.

mherchel’s picture

Status: Active » Needs review

Fix is ready for review. The fix is somewhat ugly with an ugly selector going into buttons.css. I added at @todo stating that Navigation module will need to handle this eventually.

mgifford’s picture

But isn't this all dependent on the accent colors?

Can't clicking on any of the "accent colors" here /admin/appearance/settings/default_admin immediately give you a different color for all of the buttons (including the submit button on the bottom)

I'd never heard of phantom IDs or scoping attributes. What happens if we change the accent colors?

f0ns’s picture

StatusFileSize
new69.81 KB
new72.18 KB

Just tested this on a clean Drupal install.

This appears to be an edge case because I also had to set default_admin as the main Drupal theme to let it render the detail page of a user.

Here is the image before the MR:

Before

The MR fixes it as described:

After

f0ns’s picture

Status: Needs review » Reviewed & tested by the community
mgifford’s picture

The patch here right now is just adjusting the formatting of the comments. I do think there is a deeper issue going on here #3619933: Drupal Admin Theme Colors

  • catch committed 851e2638 on 11.4.x
    fix: #3618127 Navigation top bar action buttons in dark mode have low...

  • catch committed cc017568 on 11.x
    fix: #3618127 Navigation top bar action buttons in dark mode have low...

  • catch committed f48d0a58 on main
    fix: #3618127 Navigation top bar action buttons in dark mode have low...
catch’s picture

Version: main » 11.4.x-dev
Status: Reviewed & tested by the community » Fixed

This appears to be an edge case because I also had to set default_admin as the main Drupal theme to let it render the detail page of a user.

While this is an edge case, it's going to be the default install of Drupal core for 12.0.0 for new sites, even if we don't expect people to actually use sites like that for longer than it takes to install a front end theme.

Seems OK to go ahead with the workaround here and fix this properly once navigation introduces dark mode support - do we already have an explicit issue for that?

Committed/pushed to main, 11.x and 11.4.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.