Repository navigation
Admin UI: Share the content background seed for ThemeProvider - #87839
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: -12 B (0%) Total Size: 8.85 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
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. As a user I want to be able to add multiple close buttons so that users can close the overlay from different positions in
|
7f08f47 to
b56546b
Compare
Export `ADMIN_CONTENT_BACKGROUND` from `@wordpress/admin-ui` and use it for the content providers in the site editor and boot. Seed the boot root provider with it as well, so portaled UI in the extensible site editor matches the site editor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
563520c to
06c40f6
Compare
jameskoster
left a comment
There was a problem hiding this comment.
No strong feeling about #fcfcfc vs #f8f8f8. I suppose this work makes it easier to tweak later if we want to.
|
Just wanted to remark the main technical decision here: we're adding the default background seed color to the admin-ui package. I'm still not 100% convinced that's the right approach, and I listed all options that I considered in the PR description. In particular, I'm still unsure whether the I'd like to hear thoughts from the rest of @WordPress/gutenberg-components team. |
|
Thanks for thinking through the possibilities! Another point I might consider is whether The one problem with that is that the solution would travel with the global wp-theme script, which means consumers would need to wait until they can rely on that mechanism in the WP versions they want to support. So I'm wondering if we would want a two-prong approach where we provide a way in wp-theme as a more long term approach, but also have the value available through admin-ui as a stopgap approach 🤔 |
|
As you mentioned,
That's my thinking too. Which shape is also interesting: I had thought about a
That could work: when enough time has passed, then, we'd deprecate / remove the export from admin-ui, I assume? |
mirka
left a comment
There was a problem hiding this comment.
Yes, let's go with a two-prong approach then, and we can probably remove this side of it in the future.
What?
Follow-up to #87818 and #87287.
Adds
ADMIN_CONTENT_BACKGROUND(#fcfcfc) to@wordpress/admin-uias the sharedThemeProviderbackground seed for the content area of wp-admin apps. The site editor and boot use it instead of hard-coded values.Why?
The value was hard-coded in several places and had drifted. The site editor seeds its root provider with
#fcfcfc, but boot uses#f8f8f8, which predates #81646. Modals, popovers and dropdown menus render through portals and read the root provider, so the two site editors gave them different colors.How?
@wordpress/admin-uiexportsADMIN_CONTENT_BACKGROUNDnext togetAdminThemeColors(). It matches theThemeProviderdefault background seed.edit-siteandbootbuildCONTENT_COLORfrom it.#f8f8f8, as the site editor does.The layout and
bodybackgrounds don't change, because they use the admin color scheme. Portaled surfaces get slightly lighter neutral tokens:--wpds-color-background-surface-neutralgoes from#f8f8f8to#fcfcfc, and their borders from#d7d7d7to#dbdbdb.Note
Why a public export in
@wordpress/admin-uiadmin-uialready seedsThemeProviderfor the wp-admin apps withgetAdminThemeColors(), and bothedit-siteandbootdepend on it. A string constant costs little to keep. Alternatives:admin-ui: it's a bundled package, and the repository asks bundled packages to use regular exports.ThemeProviderreset to its default background, or have@wordpress/themeexpose its default seeds: this fixes the cause, since the apps only hard-code#fcfcfcto get the default. It changes thethemeAPI and needs its own discussion. If it lands,ADMIN_CONTENT_BACKGROUNDcan be deprecated.@wordpress/theme: itsprivateApisare due for removal in WordPress 7.3.@wordpress/base-styles: it ships only SCSS, and the seed must be a JavaScript string.@wordpress/boot:edit-sitewould have to depend on the extensible site editor's app shell.Testing Instructions
/wp-admin/admin.php?page=site-editor-v2.getComputedStyle( document.documentElement ).getPropertyValue( '--wpds-color-background-surface-neutral' )should return#fcfcfc.Testing Instructions for Keyboard
No interaction changes. Focus rings on the modal and the menu stay visible.
Screenshots
1280×800, Modern admin color scheme. The Fonts screen has no portaled surface open, so its screenshots are identical.
Use of AI Tools
Claude Code (Claude Opus 5.5) wrote the code, ran the checks, took the screenshots, and drafted this description. A human directed the change and reviews the result.
🤖 Generated with Claude Code