diff --git a/packages/admin-ui/CHANGELOG.md b/packages/admin-ui/CHANGELOG.md index 1c9e19fc1ebc69..120c3446393add 100644 --- a/packages/admin-ui/CHANGELOG.md +++ b/packages/admin-ui/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### New Features + +- Add `ADMIN_CONTENT_BACKGROUND`, the background color that seeds a `ThemeProvider` for the content area of an admin app ([#87839](https://github.com/WordPress/gutenberg/pull/87839)). + ## 3.3.0 (2026-12-02) ### Bug Fixes diff --git a/packages/admin-ui/README.md b/packages/admin-ui/README.md index acc6b15810eb08..0f2c24aed63e89 100644 --- a/packages/admin-ui/README.md +++ b/packages/admin-ui/README.md @@ -39,6 +39,10 @@ RTL versions of the stylesheets are available in the same paths, but with `-rtl` +### ADMIN_CONTENT_BACKGROUND + +Background color that seeds a `ThemeProvider` (`color.background`) for the light content area of an admin app, and for UI that belongs to it, such as portaled popovers and modals. It matches the `ThemeProvider` default background seed. + ### Breadcrumbs Renders a breadcrumb navigation trail. diff --git a/packages/admin-ui/src/admin-theme-colors/index.ts b/packages/admin-ui/src/admin-theme-colors/index.ts index 7ca5691413a3b0..8cbd3d2d5d9506 100644 --- a/packages/admin-ui/src/admin-theme-colors/index.ts +++ b/packages/admin-ui/src/admin-theme-colors/index.ts @@ -37,6 +37,14 @@ export const ADMIN_THEME_COLORS = new Map< string, AdminThemeColors >( [ [ 'light', { primary: '#007cba', background: '#eaeeed' } ], ] ); +/** + * Background color that seeds a `ThemeProvider` (`color.background`) for the + * light content area of an admin app, and for UI that belongs to it, such as + * portaled popovers and modals. It matches the `ThemeProvider` default + * background seed. + */ +export const ADMIN_CONTENT_BACKGROUND = '#fcfcfc'; + /** * Reads the active WordPress admin color scheme from the `admin-color-*` body * class and returns its primary and background colors. Intended to seed a diff --git a/packages/admin-ui/src/index.ts b/packages/admin-ui/src/index.ts index 9067325544babd..97156879dd6867 100644 --- a/packages/admin-ui/src/index.ts +++ b/packages/admin-ui/src/index.ts @@ -1,4 +1,7 @@ export { default as Breadcrumbs } from './breadcrumbs'; export { default as NavigableRegion } from './navigable-region'; export { default as Page } from './page'; -export { getAdminThemeColors } from './admin-theme-colors'; +export { + ADMIN_CONTENT_BACKGROUND, + getAdminThemeColors, +} from './admin-theme-colors'; diff --git a/packages/boot/CHANGELOG.md b/packages/boot/CHANGELOG.md index 15414cc98af87c..7fe004f86607ae 100644 --- a/packages/boot/CHANGELOG.md +++ b/packages/boot/CHANGELOG.md @@ -6,6 +6,7 @@ - Snackbars use the content colors, so their focus ring stays readable over light content ([#87818](https://github.com/WordPress/gutenberg/pull/87818)). - Keep admin routes available when the site-data prefetch fails ([#86185](https://github.com/WordPress/gutenberg/pull/86185)). +- Portaled UI, such as modals, popovers, and dropdown menus, uses the colors of the content area, as in the Site Editor ([#87839](https://github.com/WordPress/gutenberg/pull/87839)). ## 0.28.0 (2026-12-02) diff --git a/packages/boot/src/components/root/content-color.ts b/packages/boot/src/components/root/content-color.ts index 03a0754aa206f0..406977b45beadc 100644 --- a/packages/boot/src/components/root/content-color.ts +++ b/packages/boot/src/components/root/content-color.ts @@ -1,6 +1,8 @@ +import { ADMIN_CONTENT_BACKGROUND } from '@wordpress/admin-ui'; + /** - * Seeds the content surfaces, and the snackbars that float over them, with the - * default background color instead of the admin color scheme's. Nested - * providers inherit the admin scheme's primary color. + * Seeds the root provider, the content surfaces, and the snackbars that float + * over them with the content background color instead of the admin color + * scheme's. Nested providers inherit the admin scheme's primary color. */ -export const CONTENT_COLOR = { background: '#fcfcfc' }; +export const CONTENT_COLOR = { background: ADMIN_CONTENT_BACKGROUND }; diff --git a/packages/boot/src/components/root/index.tsx b/packages/boot/src/components/root/index.tsx index fc22277e779c16..c276b3c5eb9356 100644 --- a/packages/boot/src/components/root/index.tsx +++ b/packages/boot/src/components/root/index.tsx @@ -63,7 +63,7 @@ export default function Root() {