Refactor admin-ui Page component to use @wordpress/theme tokens and @wordpress/ui layout primitive#75963
Merged
jameskoster merged 7 commits intotrunkfrom Mar 6, 2026
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Refactors the
admin-uiPage and Header components to use@wordpress/themedesign tokens and theStackcomponent from@wordpress/ui.Why
The Page component relied on experimental
@wordpress/componentsabstractions (__experimentalHeading,__experimentalHStack,__experimentalVStack) and Sass variables from@wordpress/base-styles. Migrating to@wordpress/themetokens and theStacklayout primitive aligns this component with the design system's token-based approach, making it easier to maintain and ensuring it benefits from theme-level features.How
header.tsx: ReplacedHeadingwith a plain<h2>styled via a new CSS class. Replaced allHStackandVStackinstances withStackfrom@wordpress/ui— the outerVStackusesrender={ <header /> }to preserve the semantic<header>element while leveraging Stack's layout.style.scss: Removed all@wordpress/base-stylesSass imports and replaced every variable/mixin usage with--wpds-*CSS custom properties (colors, spacing, typography, borders). Added a new.admin-ui-page__header-titlerule with heading font tokens and text truncation.package.json: Added@wordpress/uias a dependency.Token mapping
$white--wpds-color-bg-surface-neutral-strong$gray-800--wpds-color-fg-content-neutral$gray-100--wpds-color-stroke-surface-neutral-weak$gray-700--wpds-color-fg-content-neutral-weak$grid-unit-20/$grid-unit-30--wpds-dimension-padding-lg/--wpds-dimension-padding-2xl$grid-unit-10--wpds-dimension-padding-xs@include body-medium()--wpds-font-size-md/--wpds-font-line-height-md$helptext-font-size--wpds-font-size-smTesting
Screenshots