Skip to content

Commit 6c76206

Browse files
authored
Site Editor: Fix admin color scheme bleeding through the mobile content scrollbar gutter (#79056)
1 parent ee206cb commit 6c76206

2 files changed

Lines changed: 27 additions & 8 deletions

File tree

packages/edit-site/src/components/layout/index.js

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,18 @@ function Layout() {
184184
}
185185
/>
186186
) }
187-
<SidebarContent routeKey={ routeKey }>
188-
{ areas.mobileContent ? (
189-
<ThemeProvider
190-
color={ CONTENT_COLOR }
187+
{ areas.mobileContent ? (
188+
/*
189+
* ThemeProvider wraps SidebarContent (rather than
190+
* just the content) so the scroll wrapper it renders
191+
* inherits the content background tokens. See
192+
* `.edit-site-sidebar__screen-wrapper` in style.scss.
193+
*/
194+
<ThemeProvider
195+
color={ CONTENT_COLOR }
196+
>
197+
<SidebarContent
198+
routeKey={ routeKey }
191199
>
192200
<div className="edit-site-layout__mobile-content">
193201
<ErrorBoundary>
@@ -196,13 +204,17 @@ function Layout() {
196204
}
197205
</ErrorBoundary>
198206
</div>
199-
</ThemeProvider>
200-
) : (
207+
</SidebarContent>
208+
</ThemeProvider>
209+
) : (
210+
<SidebarContent
211+
routeKey={ routeKey }
212+
>
201213
<ErrorBoundary>
202214
{ areas.mobileSidebar }
203215
</ErrorBoundary>
204-
) }
205-
</SidebarContent>
216+
</SidebarContent>
217+
) }
206218
<SaveHub />
207219
<SavePanel />
208220
</>

packages/edit-site/src/components/layout/style.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@
8484
display: flex;
8585
flex-direction: column;
8686
flex-grow: 1;
87+
}
88+
89+
// On mobile, the content surface lives on the scroll wrapper
90+
// (not the inner content element) so it also covers the wrapper's
91+
// reserved scrollbar gutter, preventing the theme background color from
92+
// bleeding through.
93+
.edit-site-sidebar__screen-wrapper:has(.edit-site-layout__mobile-content) {
8794
background: var(--wpds-color-bg-surface-neutral);
8895
}
8996

0 commit comments

Comments
 (0)