Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/admin-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions packages/admin-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ RTL versions of the stylesheets are available in the same paths, but with `-rtl`

<!-- START TOKEN(Autogenerated API docs) -->

### 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.
Expand Down
8 changes: 8 additions & 0 deletions packages/admin-ui/src/admin-theme-colors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion packages/admin-ui/src/index.ts
Original file line number Diff line number Diff line change
@@ -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';
1 change: 1 addition & 0 deletions packages/boot/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
10 changes: 6 additions & 4 deletions packages/boot/src/components/root/content-color.ts
Original file line number Diff line number Diff line change
@@ -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 };
2 changes: 1 addition & 1 deletion packages/boot/src/components/root/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function Root() {
<PluginArea />
<ThemeProvider
isRoot
color={ { ...themeColors, background: '#f8f8f8' } }
color={ { ...themeColors, ...CONTENT_COLOR } }
>
<ThemeProvider color={ themeColors }>
<div
Expand Down
2 changes: 1 addition & 1 deletion packages/boot/src/components/root/single-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function RootSinglePage() {
<PluginArea />
<ThemeProvider
isRoot
color={ { ...themeColors, background: '#f8f8f8' } }
color={ { ...themeColors, ...CONTENT_COLOR } }
>
<ThemeProvider color={ themeColors }>
<div
Expand Down
8 changes: 6 additions & 2 deletions packages/edit-site/src/components/layout/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import clsx from 'clsx';
import { NavigableRegion, getAdminThemeColors } from '@wordpress/admin-ui';
import {
ADMIN_CONTENT_BACKGROUND,
NavigableRegion,
getAdminThemeColors,
} from '@wordpress/admin-ui';
import {
__unstableMotion as motion,
__unstableAnimatePresence as AnimatePresence,
Expand Down Expand Up @@ -42,7 +46,7 @@ const { useStyle, UploadProgressSnackbar } = unlock( editorPrivateApis );

const ANIMATION_DURATION = 0.3;
// Reset to the default background color.
const CONTENT_COLOR = { background: '#fcfcfc' };
const CONTENT_COLOR = { background: ADMIN_CONTENT_BACKGROUND };

function Layout() {
const { query, name: routeKey, areas, widths } = useLocation();
Expand Down
Loading