Skip to content

Try: Hide the Popover and Menu stroke and strengthen light elevation - #87288

Closed
jameskoster wants to merge 1 commit into
add/theme-luminance-elevationfrom
try/elevation-no-popover-stroke
Closed

jameskoster wants to merge 1 commit into
add/theme-luminance-elevationfrom
try/elevation-no-popover-stroke

Conversation

@jameskoster

@jameskoster jameskoster commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What?

Follow up to #87287, stacked on top of it. This needs design review before merging: it's an experiment to answer that PR's open question.

It hides the stroke on Popover and Menu in both @wordpress/ui and @wordpress/components, and raises the elevation shadow's minimum opacity to make up for it on light backgrounds. This makes elevation treatment consistent across consumers; no strokes.

Why?

In #87287 the stroke on popovers and menus competes with the new top-edge highlight on dark seeds. The stroke is lighter than the surface there, so it draws a light outline on all four sides. This PR shows what the shadow alone looks like, so the two approaches can be compared in the real components.

How?

  • @wordpress/ui: the Popover surface, the Menu popup and the shared item popup (Select, Combobox, Autocomplete) keep their 1px border but make it transparent, so the layout and the Popover arrow alignment don't change. The Popover arrow's stroke is transparent too. In forced-colors mode, which removes box shadows, the border switches to CanvasText, as Dialog and Drawer already do.
  • @wordpress/components: Popover and Menu drop the stroke ring from their box-shadow, and the triangle on Popover drops its stroke. The is-alternate Popover style and the toolbar Menu keep theirs. Both already have outlines that only show in forced-colors mode, so high contrast still gets an edge.
  • Shadow strength: the minimum elevation opacity goes from 0.05 to 0.08, so a white popover or menu over white content still has an edge. The dark end stays at 0.3, so the change is mostly at the light end. On the default background the shadows go from about 5.5% to 8.3%.
  • Story: Design System > Theme > Elevation now has a plain on/off strokes control, since no level uses a stroke by default anymore.

Things to look at

  • White on white: open a @wordpress/ui Menu or Select over white content. That's where the stroke mattered most, and it decides whether 0.08 is enough.
  • Everything else gets heavier: a higher minimum makes every shadow a bit stronger on light themes, including tooltips and dialogs, not only popovers and menus.
  • Dark seeds: compare with Theme: Add shadow tokens that adapt to the background seed #87287 to see whether the top-edge highlight reads better without the stroke.

Screenshots

Screenshot 2026-11-23 at 17 47 41 Screenshot 2026-11-23 at 17 47 50

Testing Instructions

  1. Run npm run storybook:dev.
  2. Open Design System > Theme > Elevation > Background Sweep. Toggle strokes to compare the shadows with and without a stroke at each background.
  3. Open the @wordpress/ui Menu, Popover and Select stories and the @wordpress/components Menu, Popover and DropdownMenu stories. Check that the popups still stand out from the page on the default light background and on a dark one (Storybook theme toolbar).
  4. In Windows high-contrast mode, or with forced colors emulated in the browser devtools, check that the popups still have a visible border or outline.

Testing Instructions for Keyboard

No interaction changes. The affected popups open, close and move focus with the keyboard as before.

Use of AI Tools

Written with Claude Code (Claude Opus 5.5), based on a discussion of the open question in #87287.

🤖 Generated with Claude Code

Make the Popover, Menu and item popup (Select, Combobox, Autocomplete)
borders transparent in @wordpress/ui, and drop the stroke ring from the
@wordpress/components Popover and Menu, so the elevation shadow alone
separates them from the page. Forced-colors mode keeps a visible border
or outline.

Raise the minimum elevation shadow opacity from 0.05 to 0.08 to make up
for the missing stroke on light backgrounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jameskoster jameskoster added [Package] Components /packages/components [Type] Experimental Experimental feature or API. [Package] Theme /packages/theme [Package] UI /packages/ui labels Nov 23, 2026
@github-actions github-actions Bot added the [Package] Base styles /packages/base-styles label Nov 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

📦 Bundle size

Size Change: +325 B (0%)

Total Size: 8.7 MB

📦 View Changed
Filename Size Change
build/modules/boot/index.min.js 51.7 kB +2 B (0%)
build/modules/core-fields/attachment.min.js 44.2 kB +4 B (+0.01%)
build/modules/core-fields/post_type_supports.min.js 82 kB +21 B (+0.03%)
build/modules/core-fields/wp_template_part.min.js 39.5 kB -1 B (0%)
build/modules/workflow/index.min.js 42.2 kB +23 B (+0.05%)
build/scripts/block-directory/index.min.js 42.5 kB +4 B (+0.01%)
build/scripts/block-editor/index.min.js 557 kB +53 B (+0.01%)
build/scripts/block-library/index.min.js 428 kB +44 B (+0.01%)
build/scripts/components/index.min.js 354 kB +25 B (+0.01%)
build/scripts/edit-site/index.min.js 383 kB +46 B (+0.01%)
build/scripts/editor/index.min.js 572 kB +78 B (+0.01%)
build/scripts/format-library/index.min.js 73.3 kB +17 B (+0.02%)
build/scripts/media-utils/index.min.js 238 kB +32 B (+0.01%)
build/scripts/notices/index.min.js 47.7 kB +3 B (+0.01%)
build/scripts/widgets/index.min.js 65 kB +16 B (+0.02%)
build/styles/components/style-rtl.css 18.2 kB -11 B (-0.06%)
build/styles/components/style-rtl.min.css 15.4 kB -11 B (-0.07%)
build/styles/components/style.css 18.3 kB -10 B (-0.05%)
build/styles/components/style.min.css 15.4 kB -12 B (-0.08%)
build/styles/theme/design-tokens-rtl.css 3.51 kB +1 B (+0.03%)
build/styles/theme/design-tokens.css 3.51 kB +1 B (+0.03%)

1478719 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric fcb2392 add/theme-luminance-elevation % Change
timeToFirstByte 55.85 ms +6.54% -3.85% 55.15 ms +3.35% -2.54% 1.27%
largestContentfulPaint 88 ms +4.55% -4.55% 90 ms +2.22% -6.67% -2.22%
lcpMinusTtfb 30.3 ms +16.5% -7.26% 30.6 ms +23.04% -9.31% -0.98%
wpBeforeTemplate 29.52 ms +8.74% -4.03% 28.72 ms +4.25% -1.11% 2.79%
wpTemplate 22.37 ms +3.22% -3.26% 22.29 ms +1.97% -3.14% 0.36%
wpTotal 52.08 ms +6.49% -3.8% 51.23 ms +3.63% -2.38% 1.66%
wpMemoryUsage 7.75 MB +0% -0% 7.74 MB +0% -0% 0.11%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric fcb2392 add/theme-luminance-elevation % Change
timeToFirstByte 46.55 ms +8.16% -2.47% 48 ms +6.35% -4.48% -3.02%
largestContentfulPaint 84 ms +4.76% -4.76% 84 ms +4.76% -4.76% 0%
lcpMinusTtfb 35.35 ms +6.22% -2.12% 34.9 ms +4.87% -2.58% 1.29%
wpBeforeTemplate 26.49 ms +7.55% -1.7% 26.87 ms +10.31% -3.09% -1.41%
wpTemplate 16.63 ms +3.85% -3.31% 16.78 ms +3.93% -4.59% -0.89%
wpTotal 43.38 ms +7.98% -2.31% 44.78 ms +6.39% -4.87% -3.13%
wpMemoryUsage 6.44 MB +0% -0% 6.43 MB +0% -0% 0.13%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric fcb2392 add/theme-luminance-elevation % Change
mediaProcessingJpeg 398.19 ms +1.82% -0.28% 401.2 ms +0.95% -0.52% -0.75%
mediaProcessingAvif 6152.01 ms +0.48% -0.02% 6182.86 ms +0.08% -0.41% -0.5%
mediaProcessingJpegToAvif 4241.82 ms +0.39% -0.13% 4256.29 ms +0.08% -0.16% -0.34%

media-upload

Metric fcb2392 add/theme-luminance-elevation % Change
jpegUploadProcessing 1998.82 ms +2.24% -24.03% 1969.22 ms +1.52% -22.4% 1.5%
pngUploadProcessing 278.98 ms +1.73% -5.64% 275.08 ms +2.81% -2.61% 1.42%
largeJpegUploadProcessing 1973.97 ms +0.85% -23.45% 1953.64 ms +1.28% -23.08% 1.04%
multipleImageUploadProcessing 2113.64 ms +0.98% -6.58% 2067.29 ms +1.15% -0.59% 2.24%

post-editor

Metric fcb2392 add/theme-luminance-elevation % Change
serverResponse 329.36 ms +1.98% -9.88% 323.08 ms +4.11% -9.75% 1.94%
firstPaint 342.77 ms +9.53% -2.73% 340.33 ms +10.87% -6.44% 0.72%
domContentLoaded 682.48 ms +2.22% -1.68% 661.22 ms +2.36% -1.56% 3.22%
loaded 683.56 ms +2.24% -1.69% 662.06 ms +2.37% -1.57% 3.25%
firstContentfulPaint 382.04 ms +3.61% -1.72% 376.81 ms +1.06% -1.73% 1.39%
firstBlock 1849.97 ms +1.56% -2.19% 1781.51 ms +0.64% -0.55% 3.84%
type 16.58 ms +8.32% -11.1% 15.34 ms +3.72% -3% 8.08%
typeWithoutInspector 16 ms +6.13% -8.44% 15.86 ms +4.54% -11.29% 0.88%
typeWithTopToolbar 20.77 ms +7.66% -9.24% 19.49 ms +5.03% -7.9% 6.57%
typeContainer 6.73 ms +7.58% -10.25% 6.91 ms +3.04% -4.34% -2.6%
focus 88.75 ms +13.21% -3.8% 93.21 ms +6.44% -8.05% -4.78%
firstFocus 211.18 ms +0% -0% 219.03 ms +0% -0% -3.58%
selectAll 307.91 ms +3.43% -1.23% 305.45 ms +2.98% -0.54% 0.81%
undo 24.45 ms +6.75% -3.56% 24.73 ms +6.75% -4.53% -1.13%
listViewOpen 52.57 ms +9.13% -5.67% 50.44 ms +7.77% -8.07% 4.22%
inserterOpen 35.48 ms +12.01% -9.64% 33.31 ms +6.84% -9.94% 6.51%
inserterHover 10.05 ms +7.26% -8.16% 10 ms +8.8% -6.7% 0.5%
inserterSearch 7.19 ms +6.68% -7.23% 7.18 ms +4.6% -5.15% 0.14%
loadPatterns 509.13 ms +3.11% -1.59% 532 ms +4.5% -3.48% -4.3%
wpTotal 320.7 ms +1.84% -10.21% 314.41 ms +4.2% -10.03% 2%
wpMemoryUsage 14.81 MB +0% -0% 14.81 MB +0% -0% 0.04%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric fcb2392 add/theme-luminance-elevation % Change
serverResponse 321.49 ms +2.77% -5.12% 317.66 ms +1.3% -6.28% 1.21%
firstPaint 323.05 ms +12.35% -3.44% 340.18 ms +12.2% -3.94% -5.04%
domContentLoaded 671.03 ms +1.23% -1% 670.28 ms +3.18% -1.59% 0.11%
loaded 671.91 ms +1.23% -1% 671.1 ms +3.19% -1.59% 0.12%
firstContentfulPaint 380.16 ms +2.4% -2.02% 378.18 ms +4.48% -1.69% 0.52%
firstBlock 2092.77 ms +0.84% -2.29% 2076.34 ms +0.47% -1.81% 0.79%
type 15.62 ms +4.93% -7.49% 15.65 ms +6.39% -9.14% -0.19%
navigate 94.29 ms +7.03% -3.53% 94.01 ms +3.7% -1.24% 0.3%
loadPatterns 1254.74 ms +4.71% -9.83% 1164.54 ms +5.34% -4.21% 7.75%
loadPages 944.81 ms +2.3% -1.35% 930.13 ms +5.76% -1.7% 1.58%
wpTotal 313.15 ms +2.85% -5.36% 309.29 ms +1.33% -6.51% 1.25%
wpMemoryUsage 12.84 MB +0% -0% 12.82 MB +0% -0% 0.11%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

1478719 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.

Navigates the list via UP/DOWN arrow keys from action buttons 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 Two Edit Actions' }).getByRole('button', { name: 'Edit' })
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' }) with timeout 5000ms
  - waiting for getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' })
    14 × locator resolved to <button type="button" tabindex="-1" class="components-button is-small" id="view-list-0-177-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:243:5
should select synced pattern in /test/e2e/specs/editor/various/writing-flow.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/block"]')
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/block"]') with timeout 5000ms
  - waiting for locator('[name="editor-canvas"]').contentFrame().locator('[data-type="core/block"]')
    14 × locator resolved to <div tabindex="0" role="document" draggable="true" data-title="Pattern" data-type="core/block" data-is-drop-zone="true" aria-label="Block: Pattern" id="block-6d1c9d71-11b1-4966-82dd-02d02cfe92e7" data-block="6d1c9d71-11b1-4966-82dd-02d02cfe92e7" class="block-editor-block-list__block wp-block is-selected is-reusable block-library-block__reusable-block-container wp-block-block block-editor-block-list__layout">…</div>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/writing-flow.spec.js:1464:5

1478719 Run

@jameskoster

Copy link
Copy Markdown
Contributor Author

Closing for now: review on #87287 favours keeping the popover and menu stroke, since on dark seeds it does most of the separating. We can revisit hiding it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Base styles /packages/base-styles [Package] Components /packages/components [Package] Theme /packages/theme [Package] UI /packages/ui [Type] Experimental Experimental feature or API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant