Skip to content
Closed
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/boot/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Bug Fixes

- Use a single root `ThemeProvider` for boot layouts so document-level design tokens match the boot layout theme context. ([#79679](https://github.com/WordPress/gutenberg/pull/79679))

## 0.16.0 (2026-06-24)

### Enhancements
Expand Down
249 changes: 119 additions & 130 deletions packages/boot/src/components/root/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,143 +63,132 @@ export default function Root() {
return (
<SlotFillProvider>
<Tooltip.Provider>
<ThemeProvider
isRoot
color={ { ...themeColors, background: '#f8f8f8' } }
>
<ThemeProvider color={ themeColors }>
<div
className={ clsx( 'boot-layout', {
'has-canvas': !! canvas || canvas === null,
'has-full-canvas': isFullScreen,
} ) }
>
<SavePanel />
<SnackbarNotices className="boot-notices__snackbar" />
{ isMobileViewport && (
<Page.SidebarToggleFill>
<Button
icon={ menu }
<ThemeProvider isRoot color={ themeColors }>
<div
className={ clsx( 'boot-layout', {
'has-canvas': !! canvas || canvas === null,
'has-full-canvas': isFullScreen,
} ) }
>
<SavePanel />
<SnackbarNotices className="boot-notices__snackbar" />
{ isMobileViewport && (
<Page.SidebarToggleFill>
<Button
icon={ menu }
onClick={ () =>
setIsMobileSidebarOpen( true )
}
label={ __( 'Open navigation panel' ) }
size="compact"
/>
</Page.SidebarToggleFill>
) }
{ /* Mobile Sidebar Backdrop */ }
<AnimatePresence>
{ isMobileViewport &&
isMobileSidebarOpen &&
! isFullScreen && (
<motion.div
initial={ { opacity: 0 } }
animate={ { opacity: 1 } }
exit={ { opacity: 0 } }
transition={ {
type: 'tween',
duration: disableMotion ? 0 : 0.2,
ease: 'easeOut',
} }
className="boot-layout__sidebar-backdrop"
onClick={ () =>
setIsMobileSidebarOpen( true )
setIsMobileSidebarOpen( false )
}
label={ __( 'Open navigation panel' ) }
size="compact"
onKeyDown={ ( event ) => {
if ( event.key === 'Escape' ) {
setIsMobileSidebarOpen( false );
}
} }
role="button"
tabIndex={ -1 }
aria-label={ __(
'Close navigation panel'
) }
/>
</Page.SidebarToggleFill>
) }
{ /* Mobile Sidebar Backdrop */ }
<AnimatePresence>
{ isMobileViewport &&
isMobileSidebarOpen &&
! isFullScreen && (
<motion.div
initial={ { opacity: 0 } }
animate={ { opacity: 1 } }
exit={ { opacity: 0 } }
transition={ {
type: 'tween',
duration: disableMotion
? 0
: 0.2,
ease: 'easeOut',
} }
className="boot-layout__sidebar-backdrop"
onClick={ () =>
setIsMobileSidebarOpen( false )
) }
</AnimatePresence>
{ /* Mobile Sidebar */ }
<AnimatePresence>
{ isMobileViewport &&
isMobileSidebarOpen &&
! isFullScreen && (
<motion.div
initial={ { x: '-100%' } }
animate={ { x: 0 } }
exit={ { x: '-100%' } }
transition={ {
type: 'tween',
duration: disableMotion ? 0 : 0.2,
ease: 'easeOut',
} }
className="boot-layout__sidebar is-mobile"
>
<Sidebar />
</motion.div>
) }
</AnimatePresence>
{ /* Desktop Sidebar */ }
{ ! isMobileViewport && ! isFullScreen && (
<div className="boot-layout__sidebar">
<Sidebar />
</div>
) }
<div className="boot-layout__surfaces">
<ThemeProvider
color={ {
...themeColors,
background: '#ffffff',
} }
>
<Outlet />
{ /* Render Canvas in Root to prevent remounting on route changes */ }
{ ( canvas || canvas === null ) && (
<div
className={ clsx(
'boot-layout__canvas',
{
'has-mobile-drawer':
canvas?.isPreview &&
isMobileViewport,
}
onKeyDown={ ( event ) => {
if ( event.key === 'Escape' ) {
setIsMobileSidebarOpen(
false
);
}
} }
role="button"
tabIndex={ -1 }
aria-label={ __(
'Close navigation panel'
) }
>
{ canvas?.isPreview &&
isMobileViewport && (
<div className="boot-layout__mobile-sidebar-drawer">
<Button
icon={ menu }
onClick={ () =>
setIsMobileSidebarOpen(
true
)
}
label={ __(
'Open navigation panel'
) }
size="compact"
/>
</div>
) }
<CanvasRenderer
canvas={ canvas }
routeContentModule={
routeContentModule
}
/>
) }
</AnimatePresence>
{ /* Mobile Sidebar */ }
<AnimatePresence>
{ isMobileViewport &&
isMobileSidebarOpen &&
! isFullScreen && (
<motion.div
initial={ { x: '-100%' } }
animate={ { x: 0 } }
exit={ { x: '-100%' } }
transition={ {
type: 'tween',
duration: disableMotion
? 0
: 0.2,
ease: 'easeOut',
} }
className="boot-layout__sidebar is-mobile"
>
<Sidebar />
</motion.div>
) }
</AnimatePresence>
{ /* Desktop Sidebar */ }
{ ! isMobileViewport && ! isFullScreen && (
<div className="boot-layout__sidebar">
<Sidebar />
</div>
) }
<div className="boot-layout__surfaces">
<ThemeProvider
color={ {
...themeColors,
background: '#ffffff',
} }
>
<Outlet />
{ /* Render Canvas in Root to prevent remounting on route changes */ }
{ ( canvas || canvas === null ) && (
<div
className={ clsx(
'boot-layout__canvas',
{
'has-mobile-drawer':
canvas?.isPreview &&
isMobileViewport,
}
) }
>
{ canvas?.isPreview &&
isMobileViewport && (
<div className="boot-layout__mobile-sidebar-drawer">
<Button
icon={ menu }
onClick={ () =>
setIsMobileSidebarOpen(
true
)
}
label={ __(
'Open navigation panel'
) }
size="compact"
/>
</div>
) }
<CanvasRenderer
canvas={ canvas }
routeContentModule={
routeContentModule
}
/>
</div>
) }
</ThemeProvider>
</div>
</div>
) }
</ThemeProvider>
</div>
</ThemeProvider>
</div>
</ThemeProvider>
</Tooltip.Provider>
</SlotFillProvider>
Expand Down
68 changes: 30 additions & 38 deletions packages/boot/src/components/root/single-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,45 +46,37 @@ export default function RootSinglePage() {

return (
<SlotFillProvider>
<ThemeProvider
isRoot
color={ { ...themeColors, background: '#f8f8f8' } }
>
<ThemeProvider color={ themeColors }>
<div
className={ clsx(
'boot-layout boot-layout--single-page',
{
'has-canvas': !! canvas || canvas === null,
'has-full-canvas': isFullScreen,
}
) }
>
<SavePanel />
<SnackbarNotices className="boot-notices__snackbar" />
<div className="boot-layout__surfaces">
<ThemeProvider
color={ {
...themeColors,
background: '#ffffff',
} }
>
<Outlet />
{ /* Render Canvas in Root to prevent remounting on route changes */ }
{ ( canvas || canvas === null ) && (
<div className="boot-layout__canvas">
<CanvasRenderer
canvas={ canvas }
routeContentModule={
routeContentModule
}
/>
</div>
) }
</ThemeProvider>
</div>
<ThemeProvider isRoot color={ themeColors }>
<div
className={ clsx( 'boot-layout boot-layout--single-page', {
'has-canvas': !! canvas || canvas === null,
'has-full-canvas': isFullScreen,
} ) }
>
<SavePanel />
<SnackbarNotices className="boot-notices__snackbar" />
<div className="boot-layout__surfaces">
<ThemeProvider
color={ {
...themeColors,
background: '#ffffff',
} }
>
<Outlet />
{ /* Render Canvas in Root to prevent remounting on route changes */ }
{ ( canvas || canvas === null ) && (
<div className="boot-layout__canvas">
<CanvasRenderer
canvas={ canvas }
routeContentModule={
routeContentModule
}
/>
</div>
) }
</ThemeProvider>
</div>
</ThemeProvider>
</div>
</ThemeProvider>
</SlotFillProvider>
);
Expand Down
4 changes: 4 additions & 0 deletions packages/wp-build/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Bug Fixes

- Use the boot layout background token for generated wp-admin page body backgrounds. ([#79679](https://github.com/WordPress/gutenberg/pull/79679))

## 0.17.0 (2026-06-24)

### Documentation
Expand Down
3 changes: 1 addition & 2 deletions packages/wp-build/templates/page-wp-admin.php.template
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_render_page() {
overflow-y: auto;
}
body {
background: #fff;
background: var(--wpds-color-background-surface-neutral-weak);
}

/* Reset wp-admin padding */
Expand Down Expand Up @@ -320,4 +320,3 @@ function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_render_page() {

// Hook the enqueue function to admin_enqueue_scripts
add_action( 'admin_enqueue_scripts', '{{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_enqueue_scripts' );

Loading