Opened 4 hours ago
Last modified 2 hours ago
#65382 new enhancement
Admin color schemes: improve contrast to make sidebar compatible with Gutenberg editor chrome
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | has-patch |
| Focuses: | ui, accessibility, css | Cc: |
Description
We want the block editor and Site Editor to follow the user's admin color scheme (see https://github.com/WordPress/gutenberg/pull/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:
- The editor chrome's background color is generated from a seed, through the WPDS ramp algorithm buildBgRamp()(https://github.com/WordPress/gutenberg/blob/35487a041c6569399988a96d5956b92cd3da0a71/packages/theme/src/color-ramps/index.ts#L18). 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.
- 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).
Proposed change
Update the admin color schemes so that they:
- Use sidebar colors that the editor's ramp can reproduce, so the editor chrome can match the wp-admin sidebar
- Use primary button colors that are distinct from the sidebar colors.
- While doing that, improve the contrast for better legibility.
Change History (3)
This ticket was mentioned in PR #12026 on WordPress/wordpress-develop by @fushar.
4 hours ago
#1
- Keywords has-patch added
@simison commented on PR #12026:
3 hours ago
#2
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 commented on PR #12026:
2 hours ago
#3
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 https://github.com/WordPress/gutenberg/pull/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 |
|---|---|
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 https://github.com/WordPress/gutenberg/pull/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:
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:
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.### Sidebar contrast (white/black text vs sidebar background)
And whether they pass WCAG 2.x AA (it requires > 4.5:1 for normal text)
### 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.
### Screenshots
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 4.7-4.8
Used for: iterating the color gradients