Repository navigation
Conversation
🤖 PR meta 🤖🏷️ LabelsThis pull request needs exactly one label indicating its type, and has 0.
Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you. 📦 Bundle sizeSize Change: +125 B (0%) Total Size: 8.29 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome 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. We show no results message if there are no comments in
|
| > svg { | ||
| align-self: center; | ||
| color: $alert-yellow; | ||
| color: var(--wpds-color-foreground-content-warning-weak); |
There was a problem hiding this comment.
@jameskoster What's the best choice here, in your opinion?
- stroke vs foregroung?
- warning vs caution?
TBH, both of these color scales are not looking particularly great (we already know yellow hues are particularly tricky to make visually pleasant and with enough contrast, that's something to improve at the algo level).
Potentially, would we be open to using the info tone?
|
Since the icon is decorative does it need to pass contrast? In any case, while we're here... should we just go ahead and use a dismissible |
|
@jameskoster you have a point on the icon being decorative, but I figured it would be good to use WPDS tokens anyway? I proposed the following plan:
What do you think? |
|
Closing in favour of #84197. |
Closes #51705.
What?
Improve Tip's light-bulb contrast with WPDS colors and prevent its icon styles from affecting SVGs inside the content. The current icon is already a light bulb, so its shape is unchanged.
Why?
The existing yellow has only 1.80:1 contrast on white. Its descendant selector also gives nested SVGs the same color and an unwanted margin. ExternalLink now uses a text arrow, so the specific external-link example in the original report no longer reproduces.
How?
Use
--wpds-color-foreground-content-warning-weakfor the bulb and the neutral secondary-text token for the copy. This retains Tip's amber tone. Scope icon styling to the direct child SVG and useCanvasTextin forced-colors mode. Add an external-link story using the inserter's composition.Testing Instructions
Testing Instructions for Keyboard
Tab to the story's link and check that its focus outline remains visible in both themes.
Screenshots
Storybook captures of the inserter's tip composition.
After, dark theme:
Verification
Chromium Storybook checks measured bulb contrast of 5.22:1 on white and 8.62:1 on the dark surface. Text and links exceed 4.5:1 in both themes. Nested SVGs inherit their link's color without Tip's margin. Keyboard focus and forced colors were checked. The built stylesheet includes color fallbacks for consumers without a ThemeProvider.
A calculation across 263 background seeds and the three neutral surface tokens found a minimum bulb contrast of 3.66:1, above the 3:1 non-text contrast requirement. This does not guarantee contrast against arbitrary backgrounds outside the theme's neutral surfaces.
Build, typecheck, targeted lint, and the existing ExternalLink and semantic-color-contrast tests pass. The post-editor steps above are provided for manual review; local browser verification used Storybook.
Use of AI Tools
Codex implemented the change, ran verification, and drafted this description.