Repository navigation
Block Editor: Use theme colors in the inserter, sidebars, header, and footer - #87426
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +1.6 kB (+0.02%) Total Size: 8.73 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
|
79fa7ee to
5eb272d
Compare
|
Perhaps it's separate but the search icon in the quick inserter in dark mode is the wrong color. Everything else seems fine to me. But I am much less attached to the blueberry application than others might be. On that point the main detail to highlight is the hover state of blocks in the Inserter. As I said, for me this is fine, but let's see what others think. |
|
Good catch on the icon color, it should be fixed now. Re. the blueberry change, I left a related reflection in #87452 (comment). One alternative option here would be to adopt a neutral "inverted" look, similar to the neutral pressed |
|
As such a prominent element in the UI it might be worth discussing that in it's own PR. |
|
Yes indeed, because @fcoveram also has a different design for that doc-title element that doesn't make it a grey blob. |
Keep each element on one token role across its states: - Hovered block tiles use neutral interactive tokens, as `@wordpress/ui` Tabs do, instead of switching to brand. - Pattern previews use the neutral interactive stroke and its active state. The selected outline uses the neutral interactive foreground and stays visible on hover. Focus uses the focus stroke and width tokens. Use theme tokens for the remaining fixed colors in the editor shell: the header, footer, sidebar header, save panel, sidebar edges, and the media grid loading overlay. Remove an unused hover rule for buttons in inserter panel titles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The selected and focus rings on pattern previews are drawn inside the preview, so with theme colors they could match the pattern's own colors. Add a surface-colored band on their inner side so they keep their contrast in any theme. Set the hover color once on block tiles, so icons with registered colors keep their own foreground. Remove the close button fill in the tabbed sidebar, which repeated the sidebar surface, and an unused inserter arrow rule.
…h panel The document bar follows the field pattern from `@wordpress/ui`: a neutral interactive background and stroke that switch to their active state on hover, with the title following them. The save status uses the weak neutral foreground, with the content role while it is an inoperable indicator. The publish panel uses surface, content, and stroke tokens, and its read-only post address field matches a read-only `Input`. Remove two inserter selectors that no longer match anything.
`Text` gave the document bar heading its own fixed color, so the title did not follow the theme. Make it inherit the title color, and keep the bar at its fixed height now that it has a border. Remove a save status color that the saving and saved rules always override.
The empty state set a surface background but took its text color from the host, which a standalone inspector does not control. Pair it with the neutral content foreground, and remove a selector nothing renders. Use theme colors for the Customizer's widget inserter panel, which wraps the themed inserter.
The document outline, list view counts, revisions status, and the Customizer inserter heading kept fixed colors on surfaces that now follow the theme. Use the neutral interactive foreground for outline headings, and the neutral content foregrounds for static text.
…aces Use the brand active foreground for List View row hover, the neutral content foreground for the toolbar's informational block icon, and the neutral weak thumb for the sidebar scrollbars. Keep disabled outline headings legible with the weak content foreground, and pair outline level badges with surface and content tokens, as Badge does.
The block-type icon now follows the theme, so the contextual toolbar and its icon-label groups use the matching surface instead of white. Remove an unused Sass import from the editor header styles.
The neutral interactive background has the same value at rest and when active, so the document bar lost its hover fill. Style it as a neutral outline button instead, with every text color moving to its active state on the hover fill. Keep outline links on the neutral active foreground on hover and focus, where the admin link colors would otherwise win, and theme the parent selector fills next to the block toolbar.
Give the parent inserter's text label the neutral interactive foreground on the themed toolbar fill, and let block card titles inherit the card color instead of the admin heading color. Show the document bar's active colors on keyboard focus and press as well as hover.
The Back label now switches to its active color whenever the bar shows its active fill, including keyboard focus and press on the command button.
The nested block count sits on the themed sidebar, so use the weak neutral content foreground instead of a fixed gray.
The revealed List View and Outline scrollbar thumb uses the active thumb token, which keeps its contrast on dark surfaces. Remove a Back hover selector that the document bar's hover rule already covers.
The quick inserter set no text color, so the search icon inherited a color that ignored the active theme and stayed dark in the dark theme.
This reverts commit c3892d8.
The field container set a background but no text color, so prefix and suffix content such as the SearchControl icon inherited the color around the field and ignored the active theme. Use the interactive neutral foreground, matching the disabled state and @wordpress/ui InputLayout.
4a2f48d to
2675b0f
Compare
Reviewers asked to keep the document bar close to trunk until its redesign. Rest on the weak neutral surface fill, with no border, and take the interactive neutral active fill on hover, keyboard focus, and press.







Extracted from #82294. This change can land on trunk independently. It pairs with #87427, which does the same for the legacy
PanelandToolsPanelrendered inside these sidebars.What?
Make the inserter, pattern previews, block inspector, sidebars, document outline, editor header and footer, document bar, and publish panel follow the active theme, using WordPress Design System (WPDS) color tokens throughout.
Why?
These surfaces used fixed white backgrounds, fixed gray text and borders, and black
rgba()dividers. In a dark theme they stayed white, and some labels became nearly invisible. Some states also switched color tone: block tiles turned brand blue on hover, which the token guidelines advise against.How?
Each element keeps one token role and changes only the state segment between states. Every container background is paired with a foreground. The choices follow
@wordpress/uicomponents and the proposedItemGroup(#86676).$white,$gray-*, and blackrgba()values in the inserter, block card and inspector, tabbed sidebar, interface sidebars and their header, save panel, editor header and footer, publish panel, document outline, List View sidebar, Customizer widget inserter, and the contextual block toolbar's fill.@wordpress/uiTabs. Labels and plain icons useforeground-interactive-neutraland its-activestate, overbackground-interactive-neutral-weak-active. Icons with registered colors keep them.stroke-interactive-neutraland its-activestate on hover. The selected outline usesforeground-interactive-neutral, the token of the Tabs selected indicator, and stays visible on hover. Focus usesstroke-focus. Both rings are drawn inside the preview, because the scrolling list would clip them outside, and get a surface-colored band on their inner side so they stay visible on any pattern.background-surface-neutral-weakat rest, andbackground-interactive-neutral-weak-activeon hover, keyboard focus, and press. The title and labels follow. No interactive neutral background token has a fill at rest, so the resting fill uses the weak surface token. A redesign of the bar is out of scope here.@wordpress/uiInput, with the default field background and the mutedstroke-interactive-neutral-disabledborder.Smaller changes
foreground-interactive-neutral, with-activeon hover and focus so the admin link colors do not win. Unavailable headings stay legible with the weak content foreground. Level badges use theBadgepairs: neutral, or caution for invalid headings.foreground-interactive-brand-active.color-mix().background-thumb-neutral-weak-active.InputControlin@wordpress/componentsgives its field theforeground-interactive-neutraltext color. Icons in the prefix and suffix, such as the quick inserter's search icon, now follow the theme.Follow-ups
These still paint fixed colors on surfaces this PR themes. They will be visible once an editor dark theme exists, and need their own changes:
--wp-block-synced-color(synced tiles and pattern icons, List View, the "Responsive styles" label in the footer) has no theme-aware value. It needs one holistic change across the editor.core-data.@wordpress/uiLinkwithtone="neutral"instead of custom styles.Testing Instructions
Testing Instructions for Keyboard
Open the inserter with the keyboard. Move through the block tiles and pattern previews with the arrow keys, and insert one with Enter. Check that the focus ring on pattern previews is visible. Tab to the document bar and check that it shows its darker fill and a focus ring. Tab through the sidebar and header controls and check that focus stays visible.
Screenshots
The Storybook shots compare the hosted trunk build with a local build of this PR. The editor has no dark theme yet, so the editor shots use the default theme.
The Patterns tab of the inserter in the dark theme.
The document bar in the post editor at rest, under the pointer, and with keyboard focus.
Publish panel, default theme
Pattern previews: focused, selected, and hovered, light and dark themes
The first preview has keyboard focus, the second is selected, and the third is hovered.
Block tile hover, dark and light themes
Inserter Patterns tab, light theme
Quick inserter, dark and light themes
Tabbed sidebar, dark and light themes
Use of AI Tools
OpenAI Codex extracted the changes from #82294, ran the checks, and drafted the first description. Claude Code aligned the token choices with the WPDS guidelines, extended the change to the editor header, footer, document bar, publish panel, and outline, captured the screenshots, and rewrote this description. GPT-6.2 Sol reviewed the token usage over several rounds.