Skip to content

Admin color schemes: make sidebars compatible with Gutenberg editor chrome by improving contrast#12026

Open
fushar wants to merge 1 commit into
WordPress:trunkfrom
fushar:update-core-color-schemes
Open

Admin color schemes: make sidebars compatible with Gutenberg editor chrome by improving contrast#12026
fushar wants to merge 1 commit into
WordPress:trunkfrom
fushar:update-core-color-schemes

Conversation

@fushar
Copy link
Copy Markdown

@fushar fushar commented May 31, 2026

Trac ticket: https://core.trac.wordpress.org/ticket/65382

Summary

The block editor and Site Editor are moving toward applying the user's admin color scheme (see WordPress/gutenberg#78397). With that, the editor chrome will use the color scheme, instead of being always black. However, as also discussed in the linked PR, this has a few problems with the current color schemes:

  1. The editor chrome's background color is generated from a seed, through the WPDS ramp algorithm (buildBgRamp()). This function emits surface colors within a specific luminance bands, and cannot reproduce arbitrary colors. Most of the current scheme sidebars are outside the bands, so the editor chrome will NEVER match them regardless of the seed.
  2. The primary button may appear in the editor chrome, e.g. as Review X changes... button. So, the background color should be distinct enough from the sidebar. Currently several schemes have similar colors (e.g. the purple Ectoplasm).

This PR updates the core admin color schemes to satisfy both, while maintaining each scheme's characteristics.

Several notes:

  • With this PR I also try to reduce the number of distinct colors in each scheme. Except for the Light scheme, the primary button's background color is made equal to the currently selected sidebar menu's background color. This simplifies the color schemes.
  • I believe some color schemes currently being low-contrast is expected. However, the buildBgRamp() function CANNOT produce low-contrast colors. So, for each such schemes (like Coffee, Ocean) I tried to produce the color with the lowest contrast possible while still being similar to the original color.
  • This PR: Update the theme colors to rely on CSS variables gutenberg#23048 changed the primary button color to be the sidebar color, for several schemes (such as Ectoplasm). This PR reverts that behavior due to the reason mentioned before.

Warning

The linked Gutenberg PR must also be backported, because the primary colors are also being updated in base-styles.

Sidebar contrast (white/black text vs sidebar background)

And whether they pass WCAG 2.x AA (it requires > 4.5:1 for normal text)

Scheme Before After
Modern 16.67 ✅ unchanged
Fresh 15.89 ✅ unchanged
Light 10.03 ✅ 10.03 ✅
Blue 2.58 ❌ 8.23 ✅
Coffee 7.68 ✅ 8.19 ✅
Ectoplasm 9.17 ✅ 10.67 ✅
Midnight 11.33 ✅ 11.26 ✅
Ocean 3.48 ❌ 8.21 ✅
Sunrise 4.48 ❌ 8.21 ✅

Primary button contrast (white text vs button background)

Note that except for Light scheme, this primary button background color is now equal to that of the currently selected menu item.

Scheme Before After
Modern 5.61 ✅ unchanged
Fresh 5.17 ✅ unchanged
Light 4.15 ❌ 4.57 ✅
Blue 6.63 ✅ 4.58 ✅
Coffee 10.2 ✅ 4.96 ✅
Ectoplasm 9.17 ✅ 5.59 ✅
Midnight 3.93 ❌ 4.65 ✅
Ocean 4.44 ❌ 4.92 ✅
Sunrise 2.86 ❌ 4.58 ✅

Screenshots

Before After
Blue
Blue
Coffee
Coffee
Ectoplasm
Ectoplasm
Light
Light
Midnight
Midnight
Ocean
Ocean
Sunrise
Sunrise

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 4.7-4.8
Used for: iterating the color gradients


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions
Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@fushar fushar force-pushed the update-core-color-schemes branch 5 times, most recently from 89536e4 to a72c0d5 Compare June 1, 2026 07:13
@fushar fushar force-pushed the update-core-color-schemes branch from a72c0d5 to 1dc74e4 Compare June 1, 2026 07:44
@fushar fushar changed the title Admin color schemes: update colors for better text contrast Admin color schemes: make sidebars compatible with Gutenberg editor chrome by improving contrast Jun 1, 2026
@fushar fushar marked this pull request as ready for review June 1, 2026 08:53
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props fushar, simison.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@simison
Copy link
Copy Markdown
Member

simison commented Jun 1, 2026

I didn't test yet but adding a note to test non-site-editor pages built with WP Build; Fonts, Connectors, etc.
Similarly also plugins building pages with WP Build; a good check would be core AI plugin's settings page.

@fushar
Copy link
Copy Markdown
Author

fushar commented Jun 1, 2026

I didn't test yet but adding a note to test non-site-editor pages built with WP Build

Yep, this is addressed in the Gutenberg PR WordPress/gutenberg#78397. Together with that PR, this PR even fixes an existing bug with "disconnected" black chrome surrounding such pages. Copying here for easy reference:

Appearance -> Fonts

(see the gutter/border at bottom-left)

Before After
image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants