Skip to content

Theme: Add color warning diagnostics workbench - #81817

Merged
ciampo merged 7 commits into
trunkfrom
codex/theme-provider-color-warning-workbench
Aug 20, 2026
Merged

Theme: Add color warning diagnostics workbench#81817
ciampo merged 7 commits into
trunkfrom
codex/theme-provider-color-warning-workbench

Conversation

@ciampo

@ciampo ciampo commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #81185

See #81162

What?

Turns the existing ThemeProvider Color Scales stories into a Storybook workbench for onColorWarnings, including the #81162 reproduction and WordPress admin schemes.

Why?

ThemeProvider color warnings were not visible in Storybook. This provides one comparison surface for the later #81162 ramp-construction work.

How?

Each sample renders a real ThemeProvider and stores its warnings locally. The stories map warnings back to affected ramp steps, show compact details, and mark adjusted seed anchors with a dashed SEED ≠ outline. Production behavior is unchanged.

Testing Instructions

  1. Run npm run storybook:dev and open Theme Provider → Color Scales → Default.
  2. Confirm the defaults report No warnings. Change primary to #608010 and background to #4f386e; confirm the warning report updates.
  3. Open Sample Combinations. Confirm the dark and ThemeProvider does not enforce text contrast for active fill colors #81162 samples outline the affected primary and error steps, and Blue, Ocean, and Sunrise show SEED ≠ markers.

Testing Instructions for Keyboard

Change the Default story colors with the keyboard and confirm the labeled results update without relying on color alone.

Screenshots

Screenshot 2026-08-19 at 17 30 43

Use of AI Tools

Codex was used to implement, verify, and self-review this change.

@github-actions github-actions Bot added the [Package] Theme /packages/theme label Aug 19, 2026
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 7.74 MB

compressed-size-action

@ciampo ciampo self-assigned this Aug 19, 2026
@ciampo ciampo added the [Type] Enhancement A suggestion for improvement. label Aug 19, 2026
@ciampo
ciampo marked this pull request as ready for review August 19, 2026 15:31
@ciampo
ciampo requested a review from a team as a code owner August 19, 2026 15:31
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown

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 props-bot label.

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.

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

Thanks for improving this!

seed.value,
ramp[ tokenName ]
)
? '3px dashed #996800'

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.

Any reason why this dashed indicator is hardcoded to a strange color choice? It's a bit hard to notice.

Seed adjusted indicator

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

switched to currentColor

Comment on lines +216 to +227
{
label: 'Coffee',
source: 'WordPress admin scheme',
background: '#5b534d',
primary: '#916745',
},
{
label: 'Ectoplasm',
source: 'WordPress admin scheme',
background: '#4f386e',
primary: '#646c3e',
},

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.

We really need a central data source of all these theme constants, we've already had some issues with drift 😅 (Which is also weird because it seems like a simple string search & replace across the repo! Maybe we were unlucky with the merge timing of parallel PRs?)

@ciampo ciampo Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We do, although currently those schemes are defined in admin-ui

Do you think that's the best common place, since they're a WordPress app setting? Or should they be in the theme package?

We can iterate on this aspect in a follow-up once we have a clear direction

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.

@wordpress/base-styles would be a really natural place, if it's feasible to also start exposing a JS file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Opened #81980 to track separately

@ciampo
ciampo force-pushed the codex/theme-provider-color-warning-workbench branch from 8a9e91f to 162e950 Compare August 19, 2026 20:59
@ciampo
ciampo enabled auto-merge (squash) August 19, 2026 21:03
@ciampo
ciampo force-pushed the codex/theme-provider-color-warning-workbench branch from 162e950 to 4590f1f Compare August 20, 2026 08:26
@ciampo
ciampo merged commit 7deb382 into trunk Aug 20, 2026
44 checks passed
@ciampo
ciampo deleted the codex/theme-provider-color-warning-workbench branch August 20, 2026 09:04
@github-actions github-actions Bot added this to the Gutenberg 23.9 milestone Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[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