Repository navigation
List View: Keep selected labels, badges and focus rings readable - #87177
Conversation
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +445 B (+0.01%) Total Size: 8.72 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
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The selected row's background now comes from a custom property, so the synced row no longer needs a more specific forced-colors override. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A neutral surface badge vanishes when a theme's brand fill is close to that surface. The row's own foreground and background always contrast, so swapping them keeps the badge distinct on any brand fill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
List View select buttons never render aria-current, so the selector cannot match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
andrewserong
left a comment
There was a problem hiding this comment.
This is testing nicely for me so far! Just left a comment about the synced block. And for this bit:
Keep the purple selection and dark badge overlay for synced patterns.
What's the dark badge overlay in synced patterns? Is it the anchor, or something else?
1c4d379 to
e5333f3
Compare
|
@andrewserong I meant the background of the HTML anchor badge. I updated the PR description to say that selected synced rows keep their purple background and white text. |
There was a problem hiding this comment.
Excellent, thanks for confirming @ciampo! This is testing well for me, changes look good, and nice touch adding all the different admin schemes screenshots to the PR description, that helps showcase the contrast improvements nicely 🚀
…dPress#87177) * List View: Keep selected labels, badges and focus rings readable * List View: Link the selected row changelog entries * List View: Mention anchor badges in the changelog entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * List View: Drop the synced selector from the forced-colors background The selected row's background now comes from a custom property, so the synced row no longer needs a more specific forced-colors override. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * List View: Invert the selected row's colors for the anchor badge A neutral surface badge vanishes when a theme's brand fill is close to that surface. The row's own foreground and background always contrast, so swapping them keeps the badge distinct on any brand fill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Navigation: Drop the unused aria-current menu link selector List View select buttons never render aria-current, so the selector cannot match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * List View: Read the thumbnail separator from the selected row color Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * List View: Name the replaced color source in the changelog Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * List View: Remove the unused synced anchor badge rule * List View: Keep anchor badges readable without design tokens --------- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Split from #86614.
What?
Keep selected block labels, HTML anchor badges and action focus rings readable in List View. This also covers selected links in the Site Editor's Navigation sidebar.
Why?
On trunk, a light brand color can leave a selected heading with white text on yellow. With a primary color of
#ffdf57, the heading's text contrast improves from 1.32:1 to 12.66:1.How?
Use the theme's brand foreground and background together. Swap them for the anchor badge and use the row's text color for the inset focus ring. Synced rows keep their purple fill and white text. Standalone editors without design tokens get dark badge text on white.
Contrast between the row fill and the surrounding surface is tracked in #86614. For the dark surface
#252525and primary color#1c7c64, it drops from just over 3:1 on trunk to 2.72:1 here. The companion branch raises it to 3.31:1.Testing Instructions
Chapter one. Under Advanced → HTML anchor, enterchapter-one.Reproduce the light brand color in a plugin sidebar
With the test post open, run this in the browser console. Select the heading in the new sidebar. Reload the editor to remove the preview.
Testing Instructions for Keyboard
With List View closed and the heading selected, press Control+Option+O on macOS or Alt+Shift+O on Windows or Linux. From the heading row, press Right Arrow to focus Options and check its inset ring. Repeat with a synced pattern. If a plugin enables
showBlockMovers, check the Move buttons as well.Screenshots or screencast
Plugin sidebar with a light brand color
Site Editor navigation with the Fresh admin color scheme
Hovering the selected link now gives its text 4.59:1 contrast, up from 4.01:1.
Post editor List View in five admin color schemes
The same heading is selected with keyboard focus on Options.
Default (Modern)
Fresh
Midnight
Ocean
Sunrise
Use of AI Tools
Codex and Claude helped implement the changes. Codex ran the independent reviews, tested the editor and captured the screenshots.