Repository navigation
Conversation
The legacy `--wp-admin-theme-color` accent is a fixed value that does not adapt to the theme background. On the tinted, dark surfaces used in a dark theme, the Notice's link/secondary/tertiary action controls therefore fall below the minimum contrast ratio (~2.2:1). Redirect the accent to the theme-aware `--wpds-color-foreground-interactive-brand` token for those variants, matching the outline/minimal treatment in the `@wordpress/ui` Button. Primary actions keep the accent as their fill, so they are intentionally excluded. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
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. |
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
This feels like it's fundamentally an issue with the #79993 partially addresses the underlying need for |
|
@aduth you're right tbqh. I trusted Claude too much on this one. I'll check the other fixes. |
Resolves #80211
What?
Fixes the low-contrast link/secondary action controls in the
Noticecomponent (@wordpress/components) when rendered on a dark theme background.Why?
The legacy
--wp-admin-theme-coloraccent is a fixed value (#3858e9) that does not adapt to the theme background. When aNoticeis rendered under the design-system dark theme (ThemeProviderwith a darkbackgroundseed), the surface, border, and text tokens all regenerate correctly and remain accessible — but the action controls do not.The link and secondary/tertiary action buttons color themselves with that fixed accent, so on the tinted, dark notice surfaces they drop to roughly 2.2:1 contrast, below the WCAG minimum, and read as broken:
#3858e9blue that barely separates from the dark surface.#8eb0ff), clearly legible.The newer
@wordpress/uiButtonalready solves this by using the theme-aware--wpds-color-foreground-interactive-brandtoken for its outline/minimal variants. This change brings the legacy componentsNoticein line.How?
Redirect the accent to the theme-aware brand foreground token for the notice's non-primary action controls, using the same CSS-variable override pattern the
Buttonalready uses for its destructive variant:Primary actions are intentionally excluded — they use the accent as their fill, so they must keep the solid brand background.
In light mode
--wpds-color-foreground-interactive-brandresolves to#3858e9— identical to the previous value — so there is no visual change in light mode.Testing Instructions
🤖 Generated with Claude Code