Skip to content

Theme: Swap resting and active fills for strong neutral controls - #87429

Merged
ciampo merged 3 commits into
trunkfrom
extract/strong-neutral-fill-states-82294
Nov 26, 2026
Merged

ciampo merged 3 commits into
trunkfrom
extract/strong-neutral-fill-states-82294

Conversation

@ciampo

@ciampo ciampo commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Extracted from #82294. This proposal uses the two neutral fills already available on trunk.

What?

Swap the resting and active background colors for strong neutral controls. In the default light theme, a solid neutral Button rests at #1e1e1e and hovers at #2e2e2e. In the dark theme, it rests at #f0f0f0 and hovers at #dadada.

Why?

This is a design decision about which state gets the stronger fill. #82294 softens the color that strong neutral controls use at rest. In a review of #82294, Jay noted that neutral actions lose strength and suggested flipping the fills: darker at rest, lighter on hover or when active. This PR makes that swap first, so a resting solid control keeps the highest contrast after #82294 lands.

As a result, the two solid variants move in opposite directions on hover in the default light theme. A brand Button darkens, and a neutral Button lightens. This difference is intentional: it keeps the neutral resting fill at full strength.

The swap also changes consumers that use the active color for a persistent pressed or selected state.

How?

Swap the existing background aliases and regenerate their published values. Both states use the same foreground. Across the nine bundled admin schemes, the lowest text contrast measured for either state was 11.87:1.

Testing Instructions

  1. Open Button → Neutral in Storybook. Compare resting and hovered fills in the light and dark themes.
  2. Select a day in Calendar and toggle a pressed block toolbar button in the editor. Check that the selected or pressed state remains distinct from neighboring controls.

Testing Instructions for Keyboard

Tab to the solid neutral Button, press and hold Space, then release it. Check that the focus ring and label remain visible. Move through Calendar with the arrow keys and select a day.

Screenshots

Solid neutral Button in the default light theme.

State Trunk This PR
Rest Neutral Button at rest on trunk Neutral Button at rest after the swap
Hover Neutral Button hovered on trunk Neutral Button hovered after the swap

Use of AI Tools

OpenAI Codex extracted the token change from #82294, regenerated its outputs, checked the contrast, and drafted this description. Claude Code rebased the branch, applied the review feedback, and updated this description.

🤖 Generated with Claude Code

ciampo added a commit that referenced this pull request Nov 26, 2026
@github-actions github-actions Bot added [Package] Base styles /packages/base-styles [Package] Theme /packages/theme labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 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: +155 B (0%)

Total Size: 8.73 MB

📦 View Changed
Filename Size Change
build/modules/boot/index.min.js 55.1 kB +14 B (+0.03%)
build/scripts/block-editor/index.min.js 562 kB +11 B (0%)
build/scripts/block-library/index.min.js 430 kB +10 B (0%)
build/scripts/components/index.min.js 355 kB +10 B (0%)
build/scripts/customize-widgets/index.min.js 22.9 kB +3 B (+0.01%)
build/scripts/edit-site/index.min.js 384 kB +22 B (+0.01%)
build/scripts/edit-widgets/index.min.js 29.1 kB +6 B (+0.02%)
build/scripts/editor/index.min.js 575 kB +14 B (0%)
build/scripts/media-utils/index.min.js 238 kB +15 B (+0.01%)
build/scripts/notices/index.min.js 47.9 kB +5 B (+0.01%)
build/scripts/theme/index.min.js 28.8 kB +1 B (0%)
build/styles/components/style-rtl.css 18.6 kB +2 B (+0.01%)
build/styles/components/style-rtl.min.css 15.8 kB +1 B (+0.01%)
build/styles/components/style.css 18.7 kB +2 B (+0.01%)
build/styles/components/style.min.css 15.8 kB +1 B (+0.01%)
build/styles/edit-site/style-rtl.css 21.3 kB +4 B (+0.02%)
build/styles/edit-site/style-rtl.min.css 17.2 kB +4 B (+0.02%)
build/styles/edit-site/style.css 21.3 kB +4 B (+0.02%)
build/styles/edit-site/style.min.css 17.2 kB +4 B (+0.02%)
build/styles/edit-widgets/style-rtl.css 5.47 kB +4 B (+0.07%)
build/styles/edit-widgets/style-rtl.min.css 4.06 kB +1 B (+0.02%)
build/styles/edit-widgets/style.css 5.47 kB +2 B (+0.04%)
build/styles/edit-widgets/style.min.css 4.06 kB +2 B (+0.05%)
build/styles/editor/style-rtl.css 32.2 kB +4 B (+0.01%)
build/styles/editor/style-rtl.min.css 27.9 kB +4 B (+0.01%)
build/styles/editor/style.css 32.3 kB +5 B (+0.02%)
build/styles/editor/style.min.css 27.8 kB +4 B (+0.01%)
build/styles/theme/design-tokens-rtl.css 3.31 kB -1 B (-0.03%)
build/styles/theme/design-tokens-rtl.min.css 1.57 kB -1 B (-0.06%)
build/styles/theme/design-tokens.css 3.31 kB -1 B (-0.03%)
build/styles/theme/design-tokens.min.css 1.57 kB -1 B (-0.06%)

a8a942e Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 5d03d40 trunk % Change
timeToFirstByte 56.3 ms +12.7% -3.64% 56.9 ms +8.61% -6.15% -1.05%
largestContentfulPaint 92 ms +8.7% -8.7% 92 ms +4.35% -6.52% 0%
lcpMinusTtfb 32 ms +18.44% -9.38% 35.4 ms +8.05% -21.33% -9.6%
wpBeforeTemplate 29.55 ms +15.74% -4.77% 28.94 ms +11.4% -5.18% 2.11%
wpTemplate 23.2 ms +5.43% -4.27% 23.37 ms +8.09% -5.31% -0.73%
wpTotal 52.32 ms +11.47% -3.73% 52.79 ms +8.68% -6.35% -0.89%
wpMemoryUsage 7.75 MB +0% -0% 7.72 MB +0% -0% 0.45%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 5d03d40 trunk % Change
timeToFirstByte 45.45 ms +6.6% -2.42% 45.2 ms +9.18% -2.88% 0.55%
largestContentfulPaint 84 ms +4.76% -4.76% 80 ms +5% -2.5% 5%
lcpMinusTtfb 36.85 ms +10.45% -4.34% 34.5 ms +8.7% -3.33% 6.81%
wpBeforeTemplate 24.32 ms +5.22% -2.06% 24.19 ms +10.13% -1.9% 0.54%
wpTemplate 17.24 ms +6.96% -2.96% 17.02 ms +5.64% -3.06% 1.29%
wpTotal 41.9 ms +6.95% -2.22% 41.62 ms +8.94% -2.4% 0.67%
wpMemoryUsage 6.44 MB +0% -0% 6.41 MB +0% -0% 0.56%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 5d03d40 trunk % Change
mediaProcessingJpeg 423.57 ms +0.6% -0.76% 417.1 ms +1.65% -0.5% 1.55%
mediaProcessingAvif 6252.1 ms +0.57% -0.21% 6262.18 ms +0.36% -0.49% -0.16%
mediaProcessingJpegToAvif 4394.72 ms +0.42% -0.5% 4374.44 ms +0.31% -0.45% 0.46%

media-upload

Metric 5d03d40 trunk % Change
jpegUploadProcessing 2002.71 ms +1.42% -21.17% 1974.72 ms +0.98% -22.33% 1.42%
pngUploadProcessing 286.66 ms +3.44% -2.78% 275.53 ms +2.37% -2.66% 4.04%
largeJpegUploadProcessing 2008.54 ms +1.27% -1.52% 2001.4 ms +0.32% -0.36% 0.36%
multipleImageUploadProcessing 2101.85 ms +2.76% -0.82% 2110.56 ms +0.37% -2.32% -0.41%

post-editor

Metric 5d03d40 trunk % Change
serverResponse 307.05 ms +5.88% -6.05% 305.34 ms +5.22% -5.71% 0.56%
firstPaint 336.03 ms +22.22% -13.12% 312.24 ms +3.15% -3.57% 7.62%
domContentLoaded 658.1 ms +6.98% -3.5% 644.2 ms +1.52% -2.15% 2.16%
loaded 658.9 ms +6.99% -3.5% 644.96 ms +1.52% -2.15% 2.16%
firstContentfulPaint 374.14 ms +9.77% -3.08% 368.63 ms +1.04% -1.89% 1.49%
firstBlock 1758.1 ms +1.39% -3.27% 1713.45 ms +1.35% -0.97% 2.61%
type 14.27 ms +5.12% -7.99% 14.65 ms +3.62% -7.51% -2.59%
typeWithoutInspector 14.41 ms +1.04% -9.85% 14.77 ms +4.2% -15.91% -2.44%
typeWithTopToolbar 18.71 ms +10.26% -4.65% 18.41 ms +4.07% -5.11% 1.63%
typeContainer 6.73 ms +1.19% -9.51% 6.88 ms +6.83% -14.39% -2.18%
focus 84.31 ms +5.4% -3.06% 83.43 ms +8.37% -4.79% 1.05%
firstFocus 199.9 ms +0% -0% 202.68 ms +0% -0% -1.37%
selectAll 286.05 ms +4.67% -1.16% 303.41 ms +1.13% -1.49% -5.72%
undo 23.88 ms +6.07% -7.04% 23.55 ms +11.04% -4.12% 1.4%
listViewOpen 30.1 ms +3.59% -1.63% 31.86 ms +10.39% -4.21% -5.52%
inserterOpen 34.02 ms +10.55% -9.79% 34.66 ms +7.24% -12.84% -1.85%
inserterHover 9.54 ms +6.6% -3.77% 9.91 ms +12.11% -5.45% -3.73%
inserterSearch 6.85 ms +4.82% -7.45% 6.76 ms +28.7% -5.33% 1.33%
loadPatterns 504.53 ms +3.71% -1.51% 517.76 ms +1.68% -3.95% -2.56%
wpTotal 298.03 ms +6.21% -6.11% 296.08 ms +5.6% -5.64% 0.66%
wpMemoryUsage 14.81 MB +0% -0% 14.76 MB +0% -0% 0.33%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 5d03d40 trunk % Change
serverResponse 312.92 ms +0.72% -10.83% 303.84 ms +4.28% -7.32% 2.99%
firstPaint 346.42 ms +10.85% -11.49% 335.02 ms +9.67% -6.72% 3.4%
domContentLoaded 659.41 ms +1.57% -1.13% 653.91 ms +0.24% -0.67% 0.84%
loaded 660.21 ms +1.56% -1.14% 654.65 ms +0.24% -0.67% 0.85%
firstContentfulPaint 377.21 ms +1.8% -1.84% 368.52 ms +1% -1.87% 2.36%
firstBlock 2039.62 ms +7.54% -1.3% 2039.69 ms +1.06% -0.83% 0%
type 14.69 ms +5.72% -9.12% 14.54 ms +4.88% -6.46% 1.03%
navigate 92.95 ms +8.81% -7.09% 90.08 ms +11.46% -5.5% 3.19%
loadPatterns 1102.71 ms +14.22% -4.21% 1069.47 ms +5.74% -3.55% 3.11%
loadPages 992.43 ms +4.39% -1.24% 985.29 ms +3.33% -2.71% 0.72%
wpTotal 304.53 ms +0.77% -11.11% 295.55 ms +4.41% -7.57% 3.04%
wpMemoryUsage 12.84 MB +0% -0% 12.80 MB +0% -0% 0.28%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

a8a942e Run

@ciampo ciampo self-assigned this Nov 26, 2026
@ciampo ciampo added the [Type] Enhancement A suggestion for improvement. label Nov 26, 2026
@ciampo
ciampo marked this pull request as ready for review November 26, 2026 08:56
@ciampo
ciampo requested a review from a team as a code owner November 26, 2026 08:56
@github-actions
github-actions Bot requested a review from aduth November 26, 2026 08:57

@mirka mirka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the default light theme, solid brand buttons darken on hover, and with this change solid neutral buttons lighten. I'm assuming this is an intentional choice, and I have an instinct about why that choice was made, but it may be worth writing that reasoning down explicitly in the PR, for the record.

Comment thread packages/theme/CHANGELOG.md Resolved
@ciampo
ciampo force-pushed the extract/strong-neutral-fill-states-82294 branch from 6a2dda6 to a8a942e Compare November 26, 2026 16:45
@ciampo
ciampo enabled auto-merge (squash) November 26, 2026 16:50
@ciampo
ciampo merged commit b4bb0d3 into trunk Nov 26, 2026
90 of 91 checks passed
@ciampo
ciampo deleted the extract/strong-neutral-fill-states-82294 branch November 26, 2026 17:06
@github-actions github-actions Bot added this to the Gutenberg 24.6 milestone Nov 26, 2026
Vedant-Gandhi pushed a commit to Vedant-Gandhi/gutenberg that referenced this pull request Nov 30, 2026
…dPress#87429)

* Theme: Swap resting and active fills for strong neutral controls

* Docs: Link changelogs to WordPress#87429

* Theme: Name the swapped tokens in the changelog

---

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] Base styles /packages/base-styles [Package] Theme /packages/theme [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants