Skip to content

Components: Use WPDS stroke tokens on raised surfaces - #87840

Merged
ciampo merged 3 commits into
trunkfrom
update/components-raised-surface-strokes
Dec 2, 2026
Merged

ciampo merged 3 commits into
trunkfrom
update/components-raised-surface-strokes

Conversation

@ciampo

@ciampo ciampo commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

What?

Follow-up to #87287 (follow-up 2a). See #75266.

CustomSelectControl and Menu in @wordpress/components now draw the borders of their raised surfaces with the WPDS surface stroke tokens. The strokes of the toolbar variant stay hard-coded, with a comment that points to the block toolbar work.

Why?

Raised surfaces in @wordpress/components use a mix of WPDS tokens and hard-coded colors for their strokes. The design system hasn't decided yet whether raised surfaces should have a stroke (#87287, follow-up 2), but the strokes that exist today should still follow the theme.

How?

  • CustomSelectControl: the popover border changes from 1px solid $components-color-foreground, which is near black, to var(--wpds-border-width-xs) solid var(--wpds-color-stroke-surface-neutral). This is the stroke that the @wordpress/ui Select popup and the @wordpress/components Popover already use.
  • Menu: the border uses --wpds-color-stroke-surface-neutral directly. Inside a ThemeProvider it looks the same as before.
  • Menu separator: it uses --wpds-color-stroke-surface-neutral-weak, which is what the @wordpress/ui Menu separator and the Dropdown menu group divider use. It's lighter than before.
  • Toolbar variant: Popover (isAlternate), Dropdown and Menu (variant="toolbar") keep their high-contrast $gray-900 / foreground strokes, so they keep matching the block toolbar. A comment at each one links to Applying design system foundations to the Block Toolbar #67426 and Toolbar: Paint the floating toolbar with the Menu surface. #84567. Toolbar: Paint the floating toolbar with the Menu surface. #84567 removes the toolbar variant from these components.

Testing Instructions

  1. Run npm run storybook:dev.
  2. Open Components > @wordpress-components > Deprecated > CustomSelectControl > Default, and open the select. The popover border should be light gray, like the @wordpress/ui Select popup, not near black.
  3. Open Components > @wordpress-components > Deprecated > Menu > Default, and open the menu. The border should look the same as on trunk. The separator above "Group label" should be lighter.
  4. Switch the design system color theme to Dark in the toolbar and repeat steps 2 and 3. The border and separator should follow the dark theme.
  5. Open Components > @wordpress-components > Deprecated > Menu > Toolbar Variant. It should look the same as on trunk.

Testing Instructions for Keyboard

No interaction changes. Open the select and the menu with Enter or Space, and check the same results as above.

Screenshots or screencast

Storybook, light color theme. Before is trunk (1e3f8e76cbb), After is this branch.

Before After
CustomSelectControl popover with a near-black border CustomSelectControl popover with a light gray surface stroke
Menu, and the dark color theme

Menu, light color theme. The border is unchanged, and the separator is lighter.

Before After
Menu on trunk Menu on this branch, with a lighter separator

CustomSelectControl, dark color theme:

Before After
CustomSelectControl popover on the dark theme with a light border CustomSelectControl popover on the dark theme with the dark surface stroke

Menu, dark color theme:

Before After
Menu on the dark theme on trunk Menu on the dark theme on this branch, with a fainter separator

Use of AI Tools

Written with Claude Code (Claude Opus 5.5), at my direction: Claude made the change, captured the screenshots, and drafted this description.

🤖 Generated with Claude Code

ciampo and others added 2 commits December 2, 2026 15:42
Use the surface stroke tokens for the CustomSelectControl popover border
and the Menu border and separator. Note that the toolbar variant strokes in
Popover, Dropdown, and Menu are still hard-coded, pending the block toolbar
design.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the [Package] Components /packages/components label Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: 0 B

Total Size: 8.73 MB

81c0960 Run

🏁 Flaky tests

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

Actions are reachable via RIGHT/LEFT arrow keys in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByRole('row', { name: 'Page One Edit Actions' }).getByRole('button', { name: 'Edit' })
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByRole('row', { name: 'Page One Edit Actions' }).getByRole('button', { name: 'Edit' }) with timeout 5000ms
  - waiting for getByRole('row', { name: 'Page One Edit Actions' }).getByRole('button', { name: 'Edit' })
    14 × locator resolved to <button type="button" tabindex="-1" class="components-button is-small" id="view-list-0-296-primary-action-edit-post">Edit</button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:172:5

81c0960 Run

@ciampo ciampo self-assigned this Dec 2, 2026
@ciampo ciampo added the [Type] Enhancement A suggestion for improvement. label Dec 2, 2026
@ciampo
ciampo marked this pull request as ready for review December 2, 2026 15:13
@ciampo
ciampo requested a review from a team as a code owner December 2, 2026 15:13
@github-actions
github-actions Bot requested a review from aduth December 2, 2026 15:14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ciampo
ciampo enabled auto-merge (squash) December 2, 2026 22:01
@ciampo
ciampo disabled auto-merge December 2, 2026 22:02
@ciampo
ciampo merged commit e071673 into trunk Dec 2, 2026
96 of 102 checks passed
@ciampo
ciampo deleted the update/components-raised-surface-strokes branch December 2, 2026 22:02
@github-actions github-actions Bot added this to the Gutenberg 24.7 milestone Dec 2, 2026
ciampo added a commit that referenced this pull request Dec 2, 2026
…ThemeProvider (#87817)

* Tooltip: Invert neutral tokens instead of nesting a dark ThemeProvider

Drop the ThemeProvider that Tooltip.Popup rendered with a fixed #1e1e1e
background. Swap the neutral content tokens instead, so the tooltip
contrasts with the surrounding theme, and remove the
--_wp-ui-tooltip-shadow workaround on the positioner. Apply the same
tokens to the @wordpress/components Tooltip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tooltip: Test that the popup follows the surrounding theme

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tooltip: Add changelog entries

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tooltip: Note the token change for popup content and update stale references

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tooltip: Clarify which theme the changelogs and comments refer to

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tooltip: Consolidate changelog entries and update the theme compatibility fixture

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tooltip: Scope the fixture's theme dependency notes to the published bundle

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tooltip: List the color change as an enhancement

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tooltip: Mark the swapped color tokens as a temporary hack

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* UI: Remove the ThemeProvider compatibility fallback and private APIs dependency

No component mounts ThemeProvider since the Tooltip change, so the fallback
and its lock-unlock module have no runtime consumer. Tests import
ThemeProvider from @wordpress/theme directly. Keep @wordpress/ui in the
private APIs allowlist, because published versions still opt in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tooltip: Link the tracking issue for the dark theme decision

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tooltip: Trim mentions of the other Tooltip

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Revert "UI: Remove the ThemeProvider compatibility fallback and private APIs dependency"

This reverts commit 06bddba.

* Tooltip: Shorten code comments

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Components: Move the #87840 changelog entry to Unreleased

* Tooltip: Move the changelog entries to Unreleased and describe the consumer impact

---------

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants