ui: Uniform title and description styles across overlays#77692
Conversation
|
Size Change: 0 B Total Size: 7.78 MB ℹ️ View Unchanged
|
|
Flaky tests detected in d71e7bc. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24994788485
|
Re-apply `styles.description` className on `Dialog.Description` so its `margin-bottom` layout is preserved (only the color override is dropped). Drop the orphan `styles.description` className + `styles` import from `Popover.Description` (the rule was removed earlier in this PR). Add CHANGELOG entry under Enhancements. Made-with: Cursor
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Extracted from #77559
What?
Align
.Titleand.Descriptionstyles acrossDialog,Drawer, andPopover..titlenow setscolorexplicitly (plus the matching--_gcd-heading-colorworkaround)..descriptionno longer hard-codes a color — it now inherits from.popup.Popover.Titleadopts the shared.titleclass to match the other two overlays.Popover.Descriptiondrops the now-orphanstyles.descriptionclassName;Dialog.Descriptionkeeps its className, which now only carries themargin-bottomlayout rule.Why?
Each overlay was setting (or not setting) heading + description colors independently, with subtle drift. This makes the three overlays describe their title/description colors the same way, so future token changes propagate uniformly.
Title.
.popupalready setscolor: var(--wpds-color-fg-content-neutral), butglobal-css-defense.module.csspaints headings via:is(h1…h6).heading { color: var(--_gcd-heading-color, var(--wpds-color-fg-content-neutral)); }, which defeats inheritance. Authoringcolor(and--_gcd-heading-color) directly on.titlekeeps the title color consistent across overlays and resilient to GCD changes/removal.Description. Each overlay was overriding the description color to
--wpds-color-fg-content-neutral-weak. Removing that override lets the description inherit--wpds-color-fg-content-neutralfrom.popup, matching the title and aligning all three overlays on a single source of truth.How?
dialog/style.module.css+drawer/style.module.css: addcolor+--_gcd-heading-coloron.title; drop the description color override (Dialog.descriptionkeeps itsmargin-bottom).drawer/description.tsx+popover/description.tsx: drop the now-redundantclassName={ styles.description }and thestylesimport (the rule no longer exists for them).popover/style.module.css: add.title { color: …; --_gcd-heading-color: …; }and remove the.descriptioncolor override.popover/title.tsx: applystyles.titleto match the new rule.No prop / public-API changes.
Visual delta
.titleinstead of inherited).--wpds-color-fg-content-neutral-weakto--wpds-color-fg-content-neutral(slightly stronger). Intentional: aligns description color with the popup's foreground token across overlays.Testing Instructions
npm installcd packages/ui && npm run storybookDialog,Drawer, andPopover— title color matches across overlays.trunkby design, see Visual delta above).Use of AI Tools
Cursor + Claude Opus 4.7.
Made with Cursor