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

### Enhancements

- `Page`: Keep the header row at a consistent height regardless of whether actions are present, and stop rendering an empty actions container when no actions are provided [#76683](https://github.com/WordPress/gutenberg/pull/76683).

### Breaking Changes

- Change default `headingLevel` for the `Page` component's header from `2` to `1`, meaning from `h2` to `h1`. If you need to keep previous behaviour, use `<Page title="Example" headingLevel={ 2 }>` [#77617](https://github.com/WordPress/gutenberg/pull/77617)
Expand Down
2 changes: 0 additions & 2 deletions packages/admin-ui/src/breadcrumbs/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
list-style: none;
padding: 0;
margin: 0;
/* @TODO: Replace with a `size` token once that category exists in the theme package. */
min-height: calc(var(--wpds-dimension-base) * 8);
}

/*
Expand Down
26 changes: 16 additions & 10 deletions packages/admin-ui/src/page/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ export default function Header( {
className={ styles.header }
render={ <header /> }
>
<Stack direction="row" justify="space-between" gap="sm">
<Stack
className={ styles[ 'header-content' ] }
direction="row"
gap="sm"
justify="space-between"
>
<Stack direction="row" gap="sm" align="center" justify="start">
{ showSidebarToggle && (
<SidebarToggleSlot
Expand Down Expand Up @@ -63,15 +68,16 @@ export default function Header( {
{ breadcrumbs }
{ badges }
</Stack>
<Stack
direction="row"
gap="sm"
style={ { width: 'auto', flexShrink: 0 } }
className={ styles[ 'header-actions' ] }
align="center"
>
{ actions }
</Stack>
{ actions && (
<Stack
align="center"
className={ styles[ 'header-actions' ] }
direction="row"
gap="sm"
>
{ actions }
</Stack>
) }
</Stack>
{ subTitle && (
<Text
Expand Down
15 changes: 12 additions & 3 deletions packages/admin-ui/src/page/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
z-index: 1;
}

.header-content {
/* @TODO: Replace with a `size` token once that category exists in the theme package. */
min-height: calc(var(--wpds-dimension-base) * 8);
}

.header-actions {
flex-shrink: 0;
}

/* @TODO: Remove truncation styles once `Text` supports truncation natively. See https://github.com/WordPress/gutenberg/issues/77391 */
.header-title {
overflow: hidden;
Expand All @@ -30,9 +39,9 @@
grid-template-columns: 1fr;
grid-template-rows: 1fr;
flex-shrink: 0;
/* TODO: replace fixed size values with design tokens when ready, likely --wpds-dimension-size-sm. */
width: 24px;
height: 24px;
/* @TODO: Replace with a `size` token once that category exists in the theme package. */
width: calc(var(--wpds-dimension-base) * 6);
height: calc(var(--wpds-dimension-base) * 6);

> * {
grid-column: 1 / -1;
Expand Down
Loading