From 8d68dad6f962b8e51b0aa75e8c7da3911cb0b11e Mon Sep 17 00:00:00 2001 From: Himanshu Pathak Date: Fri, 22 May 2026 22:14:27 +0530 Subject: [PATCH 01/15] Prevent overscroll bounce for stage and inspector surfaces --- packages/boot/src/components/root/style.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/boot/src/components/root/style.scss b/packages/boot/src/components/root/style.scss index 49e48a8680f46a..fb9c9551ed8a82 100644 --- a/packages/boot/src/components/root/style.scss +++ b/packages/boot/src/components/root/style.scss @@ -86,6 +86,7 @@ .boot-layout__inspector { flex: 1; overflow-y: auto; + overscroll-behavior-y: none; background: var(--wpds-color-bg-surface-neutral); color: var(--wpds-color-fg-content-neutral); position: relative; From fae8a0c43fd200ffb0012d4cc571d96675e4fd61 Mon Sep 17 00:00:00 2001 From: Himanshu Pathak Date: Thu, 18 Jun 2026 23:42:04 +0530 Subject: [PATCH 02/15] Remove vertical layout overscroll block --- packages/boot/src/components/root/style.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/boot/src/components/root/style.scss b/packages/boot/src/components/root/style.scss index fb9c9551ed8a82..49e48a8680f46a 100644 --- a/packages/boot/src/components/root/style.scss +++ b/packages/boot/src/components/root/style.scss @@ -86,7 +86,6 @@ .boot-layout__inspector { flex: 1; overflow-y: auto; - overscroll-behavior-y: none; background: var(--wpds-color-bg-surface-neutral); color: var(--wpds-color-fg-content-neutral); position: relative; From b0dbdb17e4fb7cc258de4df52162173796672c07 Mon Sep 17 00:00:00 2001 From: Himanshu Pathak Date: Fri, 19 Jun 2026 00:12:09 +0530 Subject: [PATCH 03/15] Set background color to mask overscroll jarr --- packages/boot/src/components/root/style.scss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/boot/src/components/root/style.scss b/packages/boot/src/components/root/style.scss index 49e48a8680f46a..1ecb785d0cabb8 100644 --- a/packages/boot/src/components/root/style.scss +++ b/packages/boot/src/components/root/style.scss @@ -1,5 +1,6 @@ @use "@wordpress/base-styles/variables"; @use "@wordpress/base-styles/mixins"; +@use "@wordpress/base-styles/colors"; .boot-layout { height: 100%; @@ -82,6 +83,16 @@ } } +// The macOS elastic scroll bounce reveals whatever is behind the viewport +// (i.e. the body background). On boot-layout pages the body defaults to +// white, which creates a jarring flash against the dark rounded surfaces. +// Match the body background to the layout's dark neutral colour so the +// bounce is visually seamless on the connectors page. +// See https://github.com/WordPress/gutenberg/issues/78564 +.settings_page_options-connectors-wp-admin { + background-color: colors.$gray-900; +} + .boot-layout__stage, .boot-layout__inspector { flex: 1; From fc64bfefe1197ff0c573dd8b07ca53ca40d7c297 Mon Sep 17 00:00:00 2001 From: Himanshu Pathak Date: Fri, 26 Jun 2026 13:48:38 +0530 Subject: [PATCH 04/15] Revert base styles color approach --- packages/boot/src/components/root/style.scss | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/packages/boot/src/components/root/style.scss b/packages/boot/src/components/root/style.scss index f82aa447749a46..b6625d5a490048 100644 --- a/packages/boot/src/components/root/style.scss +++ b/packages/boot/src/components/root/style.scss @@ -1,6 +1,5 @@ @use "@wordpress/base-styles/variables"; @use "@wordpress/base-styles/mixins"; -@use "@wordpress/base-styles/colors"; .boot-layout { height: 100%; @@ -83,16 +82,6 @@ } } -// The macOS elastic scroll bounce reveals whatever is behind the viewport -// (i.e. the body background). On boot-layout pages the body defaults to -// white, which creates a jarring flash against the dark rounded surfaces. -// Match the body background to the layout's dark neutral colour so the -// bounce is visually seamless on the connectors page. -// See https://github.com/WordPress/gutenberg/issues/78564 -.settings_page_options-connectors-wp-admin { - background-color: colors.$gray-900; -} - .boot-layout__stage, .boot-layout__inspector { flex: 1; From 945f69901e2389312e673e541bc5923fb5e9d4c6 Mon Sep 17 00:00:00 2001 From: Himanshu Pathak Date: Fri, 26 Jun 2026 13:49:42 +0530 Subject: [PATCH 05/15] Use wpds token approach and set body bg color --- .../wp-build/templates/page-wp-admin.php.template | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/wp-build/templates/page-wp-admin.php.template b/packages/wp-build/templates/page-wp-admin.php.template index e8bef9d71982ff..5a086e1372633b 100644 --- a/packages/wp-build/templates/page-wp-admin.php.template +++ b/packages/wp-build/templates/page-wp-admin.php.template @@ -262,9 +262,18 @@ function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_render_page() { #wpwrap { overflow-y: auto; + background: #fff; } body { - background: #fff; + /* + * Match the body background to the boot layout's dark neutral colour. + * macOS elastic scroll bounce reveals the body background behind the + * rounded surfaces, so this prevents a jarring white flash when + * bouncing. Falls back to the equivalent literal value for browsers + * that don't support custom properties. + * See https://github.com/WordPress/gutenberg/issues/78564 + */ + background: var(--wpds-color-foreground-content-neutral, #1e1e1e); } /* Reset wp-admin padding */ From 4df499a7ebb52e154484256002dfd51859e58c0b Mon Sep 17 00:00:00 2001 From: Himanshu Pathak Date: Mon, 29 Jun 2026 11:35:39 +0530 Subject: [PATCH 06/15] Removed `var(--wpds-color-foreground-content-neutral)` fallback --- packages/wp-build/templates/page-wp-admin.php.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wp-build/templates/page-wp-admin.php.template b/packages/wp-build/templates/page-wp-admin.php.template index dc1fb19bc6546c..95128ec5d1a282 100644 --- a/packages/wp-build/templates/page-wp-admin.php.template +++ b/packages/wp-build/templates/page-wp-admin.php.template @@ -279,7 +279,7 @@ function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_render_page() { * that don't support custom properties. * See https://github.com/WordPress/gutenberg/issues/78564 */ - background: var(--wpds-color-foreground-content-neutral, #1e1e1e); + background: var(--wpds-color-foreground-content-neutral); } /* Reset wp-admin padding */ From 8b4bc0235ee78ca3df09fccf10a580c06eb85a28 Mon Sep 17 00:00:00 2001 From: Himanshu Pathak Date: Mon, 29 Jun 2026 11:49:11 +0530 Subject: [PATCH 07/15] Use `--wpds-color-background-surface-neutral-strong` for `#fff` at root lvl --- packages/wp-build/templates/page-wp-admin.php.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wp-build/templates/page-wp-admin.php.template b/packages/wp-build/templates/page-wp-admin.php.template index 95128ec5d1a282..ad44434812b27c 100644 --- a/packages/wp-build/templates/page-wp-admin.php.template +++ b/packages/wp-build/templates/page-wp-admin.php.template @@ -268,7 +268,7 @@ function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_render_page() { #wpwrap { overflow-y: auto; - background: #fff; + background: var(--wpds-color-background-surface-neutral-strong); } body { /* From ad40bd3b8fafd258ec9ad44ceb6b69cad63049b8 Mon Sep 17 00:00:00 2001 From: Himanshu Pathak Date: Tue, 30 Jun 2026 14:31:48 +0530 Subject: [PATCH 08/15] Remove hardcoded #f8f8f8 background override from isRoot ThemeProvider --- packages/boot/src/components/root/index.tsx | 5 +---- packages/boot/src/components/root/single-page.tsx | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/boot/src/components/root/index.tsx b/packages/boot/src/components/root/index.tsx index 012fe02e739573..8576dfc9ce2b03 100644 --- a/packages/boot/src/components/root/index.tsx +++ b/packages/boot/src/components/root/index.tsx @@ -63,10 +63,7 @@ export default function Root() { return ( - +
- +
Date: Tue, 30 Jun 2026 14:32:43 +0530 Subject: [PATCH 09/15] Use correct background token for body overscroll fix --- packages/wp-build/templates/page-wp-admin.php.template | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/wp-build/templates/page-wp-admin.php.template b/packages/wp-build/templates/page-wp-admin.php.template index ad44434812b27c..5260faf53ec798 100644 --- a/packages/wp-build/templates/page-wp-admin.php.template +++ b/packages/wp-build/templates/page-wp-admin.php.template @@ -272,14 +272,12 @@ function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_render_page() { } body { /* - * Match the body background to the boot layout's dark neutral colour. + * Match the body background to the boot layout's neutral surface colour. * macOS elastic scroll bounce reveals the body background behind the - * rounded surfaces, so this prevents a jarring white flash when - * bouncing. Falls back to the equivalent literal value for browsers - * that don't support custom properties. + * rounded surfaces, so this prevents a jarring flash when bouncing. * See https://github.com/WordPress/gutenberg/issues/78564 */ - background: var(--wpds-color-foreground-content-neutral); + background: var(--wpds-color-background-surface-neutral-weak); } /* Reset wp-admin padding */ From 8b7a7e615356ea269e18b2b94fe8b86da0a95086 Mon Sep 17 00:00:00 2001 From: Himanshu Pathak Date: Wed, 1 Jul 2026 21:08:33 +0530 Subject: [PATCH 10/15] Revert template changes --- packages/wp-build/templates/page-wp-admin.php.template | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/wp-build/templates/page-wp-admin.php.template b/packages/wp-build/templates/page-wp-admin.php.template index 5260faf53ec798..96c46272fbc971 100644 --- a/packages/wp-build/templates/page-wp-admin.php.template +++ b/packages/wp-build/templates/page-wp-admin.php.template @@ -268,16 +268,9 @@ function {{PREFIX}}_{{PAGE_SLUG_UNDERSCORE}}_wp_admin_render_page() { #wpwrap { overflow-y: auto; - background: var(--wpds-color-background-surface-neutral-strong); } body { - /* - * Match the body background to the boot layout's neutral surface colour. - * macOS elastic scroll bounce reveals the body background behind the - * rounded surfaces, so this prevents a jarring flash when bouncing. - * See https://github.com/WordPress/gutenberg/issues/78564 - */ - background: var(--wpds-color-background-surface-neutral-weak); + background: #fff; } /* Reset wp-admin padding */ From 35414b27e1bce5bad4256a199f329de02257f157 Mon Sep 17 00:00:00 2001 From: Himanshu Pathak Date: Wed, 1 Jul 2026 21:18:02 +0530 Subject: [PATCH 11/15] Revert bg override removal in outer TP --- packages/boot/src/components/root/index.tsx | 5 ++++- packages/boot/src/components/root/single-page.tsx | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/boot/src/components/root/index.tsx b/packages/boot/src/components/root/index.tsx index 8576dfc9ce2b03..012fe02e739573 100644 --- a/packages/boot/src/components/root/index.tsx +++ b/packages/boot/src/components/root/index.tsx @@ -63,7 +63,10 @@ export default function Root() { return ( - +
- +
Date: Wed, 1 Jul 2026 21:26:39 +0530 Subject: [PATCH 12/15] Sync body background in Root to prevent macOS overscroll flash --- packages/boot/src/components/root/index.tsx | 29 +++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/packages/boot/src/components/root/index.tsx b/packages/boot/src/components/root/index.tsx index 012fe02e739573..9d2b8d7aaa17cc 100644 --- a/packages/boot/src/components/root/index.tsx +++ b/packages/boot/src/components/root/index.tsx @@ -8,7 +8,11 @@ import clsx from 'clsx'; */ import { privateApis as routePrivateApis } from '@wordpress/route'; import { SnackbarNotices } from '@wordpress/notices'; -import { useViewportMatch, useReducedMotion } from '@wordpress/compose'; +import { + useViewportMatch, + useReducedMotion, + useIsomorphicLayoutEffect, +} from '@wordpress/compose'; import { __unstableMotion as motion, __unstableAnimatePresence as AnimatePresence, @@ -16,7 +20,7 @@ import { SlotFillProvider, } from '@wordpress/components'; import { menu } from '@wordpress/icons'; -import { useState, useEffect, useMemo } from '@wordpress/element'; +import { useState, useEffect, useRef, useMemo } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { Page, getAdminThemeColors } from '@wordpress/admin-ui'; import { Tooltip } from '@wordpress/ui'; @@ -60,6 +64,26 @@ export default function Root() { const themeColors = useMemo( getAdminThemeColors, [] ); + // Sync body background to the layout surface to avoid a jarring flash on + // macOS elastic-scroll bounce. See https://github.com/WordPress/gutenberg/issues/78564 + const layoutRef = useRef< HTMLDivElement | null >( null ); + useIsomorphicLayoutEffect( () => { + if ( ! layoutRef.current ) { + return; + } + + const bg = getComputedStyle( layoutRef.current ).backgroundColor; + if ( ! bg ) { + return; + } + + document.body.style.setProperty( 'background', bg ); + + return () => { + document.body.style.removeProperty( 'background' ); + }; + }, [] ); + return ( @@ -69,6 +93,7 @@ export default function Root() { >
Date: Wed, 1 Jul 2026 21:28:44 +0530 Subject: [PATCH 13/15] Sync body background in RootSinglePage --- .../boot/src/components/root/single-page.tsx | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/boot/src/components/root/single-page.tsx b/packages/boot/src/components/root/single-page.tsx index b1854797a62f17..c572c8fe4fe906 100644 --- a/packages/boot/src/components/root/single-page.tsx +++ b/packages/boot/src/components/root/single-page.tsx @@ -9,7 +9,8 @@ import clsx from 'clsx'; import { privateApis as routePrivateApis } from '@wordpress/route'; import { SnackbarNotices } from '@wordpress/notices'; import { SlotFillProvider } from '@wordpress/components'; -import { useMemo } from '@wordpress/element'; +import { useIsomorphicLayoutEffect } from '@wordpress/compose'; +import { useMemo, useRef } from '@wordpress/element'; import { getAdminThemeColors } from '@wordpress/admin-ui'; import { ThemeProvider } from '@wordpress/theme'; @@ -44,6 +45,26 @@ export default function RootSinglePage() { const themeColors = useMemo( getAdminThemeColors, [] ); + // Sync body background to the layout surface to avoid a jarring flash on + // macOS elastic-scroll bounce. See https://github.com/WordPress/gutenberg/issues/78564 + const layoutRef = useRef< HTMLDivElement | null >( null ); + useIsomorphicLayoutEffect( () => { + if ( ! layoutRef.current ) { + return; + } + + const bg = getComputedStyle( layoutRef.current ).backgroundColor; + if ( ! bg ) { + return; + } + + document.body.style.setProperty( 'background', bg ); + + return () => { + document.body.style.removeProperty( 'background' ); + }; + }, [] ); + return (
Date: Thu, 2 Jul 2026 09:56:55 +0530 Subject: [PATCH 14/15] Create `use-sync-body-background` utility hook for reuse --- .../root/use-sync-body-background.ts | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 packages/boot/src/components/root/use-sync-body-background.ts diff --git a/packages/boot/src/components/root/use-sync-body-background.ts b/packages/boot/src/components/root/use-sync-body-background.ts new file mode 100644 index 00000000000000..dac0f82e91a1eb --- /dev/null +++ b/packages/boot/src/components/root/use-sync-body-background.ts @@ -0,0 +1,41 @@ +/** + * WordPress dependencies + */ +import { useRef } from '@wordpress/element'; +import { useIsomorphicLayoutEffect } from '@wordpress/compose'; + +/** + * Reads the boot layout's computed background-color and mirrors it onto + * `document.body` to avoid a jarring flash on macOS elastic-scroll bounce. + * Snapshots and restores the previous inline value on unmount. + * + * TODO: Once the two top-level `ThemeProvider` instances can be merged, this + * hook can be replaced with a CSS rule on ``. + * See https://github.com/WordPress/gutenberg/pull/78587#discussion_r3481698286 + * + * @return Ref to attach to the `.boot-layout` div. + */ +export default function useSyncBodyBackground() { + const layoutRef = useRef< HTMLDivElement | null >( null ); + + useIsomorphicLayoutEffect( () => { + if ( ! layoutRef.current ) { + return; + } + + const body = layoutRef.current.ownerDocument.body; + const bg = getComputedStyle( layoutRef.current ).backgroundColor; + if ( ! bg ) { + return; + } + + const previousBackground = body.style.background; + body.style.background = bg; + + return () => { + body.style.background = previousBackground; + }; + }, [] ); + + return layoutRef; +} From 4e89ed6769b5d7b32867ebfe0925a9c08c523122 Mon Sep 17 00:00:00 2001 From: Himanshu Pathak Date: Thu, 2 Jul 2026 09:58:05 +0530 Subject: [PATCH 15/15] Use the `use-sync-body-background` hook in TP --- packages/boot/src/components/root/index.tsx | 29 +++---------------- .../boot/src/components/root/single-page.tsx | 24 ++------------- 2 files changed, 7 insertions(+), 46 deletions(-) diff --git a/packages/boot/src/components/root/index.tsx b/packages/boot/src/components/root/index.tsx index 9d2b8d7aaa17cc..11eac1325bb6d8 100644 --- a/packages/boot/src/components/root/index.tsx +++ b/packages/boot/src/components/root/index.tsx @@ -8,11 +8,7 @@ import clsx from 'clsx'; */ import { privateApis as routePrivateApis } from '@wordpress/route'; import { SnackbarNotices } from '@wordpress/notices'; -import { - useViewportMatch, - useReducedMotion, - useIsomorphicLayoutEffect, -} from '@wordpress/compose'; +import { useViewportMatch, useReducedMotion } from '@wordpress/compose'; import { __unstableMotion as motion, __unstableAnimatePresence as AnimatePresence, @@ -20,7 +16,7 @@ import { SlotFillProvider, } from '@wordpress/components'; import { menu } from '@wordpress/icons'; -import { useState, useEffect, useRef, useMemo } from '@wordpress/element'; +import { useState, useEffect, useMemo } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { Page, getAdminThemeColors } from '@wordpress/admin-ui'; import { Tooltip } from '@wordpress/ui'; @@ -35,6 +31,7 @@ import CanvasRenderer from '../canvas-renderer'; import useRouteTitle from '../app/use-route-title'; import { unlock } from '../../lock-unlock'; import type { CanvasData } from '../../store/types'; +import useSyncBodyBackground from './use-sync-body-background'; import './style.scss'; const { useLocation, useMatches, Outlet } = unlock( routePrivateApis ); @@ -64,25 +61,7 @@ export default function Root() { const themeColors = useMemo( getAdminThemeColors, [] ); - // Sync body background to the layout surface to avoid a jarring flash on - // macOS elastic-scroll bounce. See https://github.com/WordPress/gutenberg/issues/78564 - const layoutRef = useRef< HTMLDivElement | null >( null ); - useIsomorphicLayoutEffect( () => { - if ( ! layoutRef.current ) { - return; - } - - const bg = getComputedStyle( layoutRef.current ).backgroundColor; - if ( ! bg ) { - return; - } - - document.body.style.setProperty( 'background', bg ); - - return () => { - document.body.style.removeProperty( 'background' ); - }; - }, [] ); + const layoutRef = useSyncBodyBackground(); return ( diff --git a/packages/boot/src/components/root/single-page.tsx b/packages/boot/src/components/root/single-page.tsx index c572c8fe4fe906..016fecad9d49cd 100644 --- a/packages/boot/src/components/root/single-page.tsx +++ b/packages/boot/src/components/root/single-page.tsx @@ -9,8 +9,7 @@ import clsx from 'clsx'; import { privateApis as routePrivateApis } from '@wordpress/route'; import { SnackbarNotices } from '@wordpress/notices'; import { SlotFillProvider } from '@wordpress/components'; -import { useIsomorphicLayoutEffect } from '@wordpress/compose'; -import { useMemo, useRef } from '@wordpress/element'; +import { useMemo } from '@wordpress/element'; import { getAdminThemeColors } from '@wordpress/admin-ui'; import { ThemeProvider } from '@wordpress/theme'; @@ -21,6 +20,7 @@ import SavePanel from '../save-panel'; import CanvasRenderer from '../canvas-renderer'; import { unlock } from '../../lock-unlock'; import type { CanvasData } from '../../store/types'; +import useSyncBodyBackground from './use-sync-body-background'; import './style.scss'; import useRouteTitle from '../app/use-route-title'; @@ -45,25 +45,7 @@ export default function RootSinglePage() { const themeColors = useMemo( getAdminThemeColors, [] ); - // Sync body background to the layout surface to avoid a jarring flash on - // macOS elastic-scroll bounce. See https://github.com/WordPress/gutenberg/issues/78564 - const layoutRef = useRef< HTMLDivElement | null >( null ); - useIsomorphicLayoutEffect( () => { - if ( ! layoutRef.current ) { - return; - } - - const bg = getComputedStyle( layoutRef.current ).backgroundColor; - if ( ! bg ) { - return; - } - - document.body.style.setProperty( 'background', bg ); - - return () => { - document.body.style.removeProperty( 'background' ); - }; - }, [] ); + const layoutRef = useSyncBodyBackground(); return (