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
16 changes: 11 additions & 5 deletions projects/js-packages/base-styles/admin-page-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,14 @@ $jp-breakpoint-mobile: 782px;
// admin-ui 2.0.0 moved internals to CSS Modules (no `.admin-ui-page*`
// class hooks anymore). We pass `className="jp-admin-page__page"` from
// <AdminPage>; admin-ui forwards it onto the page's outer node. The
// header is a stable `<header>` element directly inside that node, so
// we anchor to `> header` instead of a class.
// page's <Header> is always rendered as the first child of that node, so
// we anchor structurally to `> :first-child` instead of a class. We used
// to target `> header`, but @wordpress/admin-ui 2.1.0 (Gutenberg PR
// WordPress/gutenberg#78001, "Fix nested landmark in header") removed
// `render={ <header /> }` from the page header's Stack so the rendered
// element changed from `<header>` to `<div>`. `:first-child` matches
// regardless of element type, keeping us forward-compatible with 2.1+
// AND backward-compatible with 2.0's `<header>`.
.jp-admin-page__page {
flex: 1 1 auto;
min-height: 0;
Expand All @@ -216,7 +222,7 @@ $jp-breakpoint-mobile: 782px;
flex-direction: column;
}

.jp-admin-page__page > header {
.jp-admin-page__page > :first-child {
flex-shrink: 0; // pinned at top of the flex column.
}

Expand All @@ -225,7 +231,7 @@ $jp-breakpoint-mobile: 782px;
// strip's own hairline becomes the only divider between header and tab
// content. Same `:has()` pattern used elsewhere in this mixin to react
// to the page's content shape.
.jp-admin-page__page:has(.jp-admin-page-tabs) > header {
.jp-admin-page__page:has(.jp-admin-page-tabs) > :first-child {
border-bottom: none;
padding-bottom: 0;
}
Expand Down Expand Up @@ -253,7 +259,7 @@ $jp-breakpoint-mobile: 782px;
// fill their bounded slot. Form-style pages keep working: their
// children stay content-sized (default `flex: 0 1 auto`) and any
// overflow still falls back to Container's `overflow: auto`.
.jp-admin-page__page > :not(header):not(.jetpack-footer) {
.jp-admin-page__page > :not(:first-child):not(.jetpack-footer) {
flex: 1 1 auto;
min-height: 0;
min-width: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Base styles: Update admin-page-layout mixin's header selector from `> header` to `> :first-child` so it keeps matching after @wordpress/admin-ui 2.1 changed the page header element from `<header>` to `<div>`.
Loading