Repository navigation
Components: Use solid brand highlights for popup items - #84583
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: +2.43 kB (+0.03%) Total Size: 8.56 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. As a user I want to be able to add multiple close buttons so that users can close the overlay from different positions in
|
|
@WordPress/gutenberg-components @WordPress/gutenberg-design This PR is also updated following the latest approach used also in #84087. Ready for a review ! (Note: I'm still finishing locally a finaly code push that uses more WPDS tokens, should be pushed soon) |
|
I noticed the items in unpadded popovers have a radius which I don't think they have on trunk, is that intentional? This interaction in the editor is a bit strange, it looks like a rogue hover style on the first item: Screen.Recording.2026-10-22.at.19.39.58.mov |
|
@jameskoster well spotted. The border radius should be better now, and I also made a change to DropdownMenu so that the first item get auto focused only when opening via keyboard |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the popup highlight styling changes.
No open issues 🎉
What changed in this PR
Aligns popup highlights in @wordpress/components with the solid brand treatment in @wordpress/ui, including supporting text and icons in editor consumers.
Changes:
- Shares paired foreground/background styles for active popup items while retaining disabled focus cues and neutral inactive submenu parents.
- Updates menu, select, and autocomplete highlights without adding navigation behavior.
- Documents custom option color behavior and adds a demonstration story and package changelog entries.
| File | Description |
|---|---|
| packages/editor/src/components/autocompleters/style.scss | Makes mention slugs inherit active item colors. |
| packages/editor/CHANGELOG.md | Records mention styling changes. |
| packages/components/src/utils/popup-item.scss | Defines hover suppression around keyboard targets. |
| packages/components/src/utils/composite-item.scss | Shares brand highlights and open-parent styles. |
| packages/components/src/menu/style.module.scss | Updates menu colors, supporting content, and disabled focus cues. |
| packages/components/src/menu-item/style.scss | Applies shared highlights to MenuItem. |
| packages/components/src/form-token-field/style.scss | Updates selected suggestions and disabled focus styling. |
| packages/components/src/dropdown/style.scss | Applies shared highlights to dropdown menu buttons. |
| packages/components/src/custom-select-control/stories/index.story.tsx | Demonstrates custom option colors. |
| packages/components/src/custom-select-control/README.md | Documents active and inactive custom color behavior. |
| packages/components/src/custom-select-control-v2/style.module.scss | Pairs active option colors and inherits hint colors. |
| packages/components/src/autocomplete/style.scss | Adds shared highlights and disabled focus cues. |
| packages/components/src/autocomplete/autocompleter-ui.tsx | Uses selection styling instead of the primary Button variant. |
| packages/components/CHANGELOG.md | Records popup highlight changes. |
| packages/block-editor/src/components/link-control/style.scss | Aligns result labels with active item colors. |
| packages/block-editor/src/components/block-switcher/style.scss | Makes highlighted transform icons inherit item colors. |
| packages/block-editor/src/autocompleters/style.scss | Clears custom icon backgrounds on active results. |
| packages/block-editor/CHANGELOG.md | Records result label and block icon updates. |
Review effort: Balanced
|
There was a conflict while trying to cherry-pick the commit to the wp/7.2 branch. Please resolve the conflict manually and create a PR to the wp/7.2 branch. PRs to wp/7.2 are similar to PRs to trunk, but you should base your PR on the wp/7.2 branch instead of trunk. |
* Components: Use neutral highlights and focus rings for popup items * Autocomplete: Fix focus rings and user mention contrast * FormTokenField: Hide suggestion focus rings after blur * Components: Align popup colors with WPDS tokens * Components: Keep popup color priority within item styles * Refine popup item corners and DropdownMenu focus * Components: Separate popup styling from menu focus changes * Keep popup brand fills on the keyboard target * Components: Preserve final popup styles after rebase * CustomSelectControl: Align option styling documentation * Popup items: Keep highlights on the active item * LinkPicker: Mock scrolling in suggestion tests * Components: Keep inactive popup item colors neutral --- (cherry picked from commit 5c21fdf) Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org> --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
* Components: Use neutral highlights and focus rings for popup items * Autocomplete: Fix focus rings and user mention contrast * FormTokenField: Hide suggestion focus rings after blur * Components: Align popup colors with WPDS tokens * Components: Keep popup color priority within item styles * Refine popup item corners and DropdownMenu focus * Components: Separate popup styling from menu focus changes * Keep popup brand fills on the keyboard target * Components: Preserve final popup styles after rebase * CustomSelectControl: Align option styling documentation * Popup items: Keep highlights on the active item * LinkPicker: Mock scrolling in suggestion tests * Components: Keep inactive popup item colors neutral --- (cherry picked from commit 5c21fdf) Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org> --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
|
This updates the pinned commit hash of the Gutenberg repository from `cc75a79186fd23e72eb015d594e82f40c6209eb5` to `c035c1a649ef68f5c1646694cf440df1d7ae6e62` (fixes cherry-picked to the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@cc75a79...c035c1a - Components: Use solid brand highlights for popup items (WordPress/gutenberg#84583) (#85848) - Fix endless sideload loop when the browser can't decode a big image (WordPress/gutenberg#83530) - Notes: Show reaction picker as a row of emoji (WordPress/gutenberg#85819) (#85892) - Notes: Add thumbs up and plus reactions (WordPress/gutenberg#85565) - Notes: Share thread focus recovery across actions (WordPress/gutenberg#85455) - Core Fields: Prevent extra space between `/` and text in slug input (WordPress/gutenberg#85935) - Notes: Add search and a status filter to the All Notes sidebar (WordPress/gutenberg#84060) - Notes: Use the note permission check when deleting a reaction (WordPress/gutenberg#85883) - [WP 7.2] Math block: Keyboard focus is trapped in the LaTeX field when the formula has an error (WordPress/gutenberg#86032) - Core fields: Keep the status icon full size when its label wraps (WordPress/gutenberg#85828) (#86050) - [WP 7.2] ToolsPanel: Keep the "Reset" label visible on the highlighted menu item (WordPress/gutenberg#86060) - Interactivity Router: Ignore router regions and attachTo targets inside data-wp-html content (WordPress/gutenberg#84919) (#86059) - [WP 7.2] wp-build: Derive CSS module class names from each stylesheet's CSS (WordPress/gutenberg#86062) - Playlist: Allow track without an attachment ID to render on the frontend (WordPress/gutenberg#83880) (#86158) - UI: Show only the day number in Calendar day cells (WordPress/gutenberg#86010) (#86183) - Notes: Tolerate a null comment in the reaction cascade hooks (WordPress/gutenberg#85959) - Rich Text: Remove stale format boundary when field loses selection (WordPress/gutenberg#86168) - Notes: Only let a reaction's author delete it (WordPress/gutenberg#85415) - Writing flow: Fix Arrow Up and Down getting stuck at the edge of the screen (WordPress/gutenberg#85408) - Try: Run e2e tests in parallel, on one wp-env site per two cores (WordPress/gutenberg#85420) - Raw handling: Keep shortcodes in text inline (WordPress/gutenberg#85795) - Fix: Fixes non-breaking space replacement tooltip (WordPress/gutenberg#85777) - Non-breaking space: Remove non-breaking spaces that would collapse when replaced (WordPress/gutenberg#85873) Props mamaduka. See #66340. git-svn-id: https://develop.svn.wordpress.org/trunk@65225 602fd350-edb4-49c9-b593-d223f7449a82
This updates the pinned commit hash of the Gutenberg repository from `cc75a79186fd23e72eb015d594e82f40c6209eb5` to `c035c1a649ef68f5c1646694cf440df1d7ae6e62` (fixes cherry-picked to the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@cc75a79...c035c1a - Components: Use solid brand highlights for popup items (WordPress/gutenberg#84583) (#85848) - Fix endless sideload loop when the browser can't decode a big image (WordPress/gutenberg#83530) - Notes: Show reaction picker as a row of emoji (WordPress/gutenberg#85819) (#85892) - Notes: Add thumbs up and plus reactions (WordPress/gutenberg#85565) - Notes: Share thread focus recovery across actions (WordPress/gutenberg#85455) - Core Fields: Prevent extra space between `/` and text in slug input (WordPress/gutenberg#85935) - Notes: Add search and a status filter to the All Notes sidebar (WordPress/gutenberg#84060) - Notes: Use the note permission check when deleting a reaction (WordPress/gutenberg#85883) - [WP 7.2] Math block: Keyboard focus is trapped in the LaTeX field when the formula has an error (WordPress/gutenberg#86032) - Core fields: Keep the status icon full size when its label wraps (WordPress/gutenberg#85828) (#86050) - [WP 7.2] ToolsPanel: Keep the "Reset" label visible on the highlighted menu item (WordPress/gutenberg#86060) - Interactivity Router: Ignore router regions and attachTo targets inside data-wp-html content (WordPress/gutenberg#84919) (#86059) - [WP 7.2] wp-build: Derive CSS module class names from each stylesheet's CSS (WordPress/gutenberg#86062) - Playlist: Allow track without an attachment ID to render on the frontend (WordPress/gutenberg#83880) (#86158) - UI: Show only the day number in Calendar day cells (WordPress/gutenberg#86010) (#86183) - Notes: Tolerate a null comment in the reaction cascade hooks (WordPress/gutenberg#85959) - Rich Text: Remove stale format boundary when field loses selection (WordPress/gutenberg#86168) - Notes: Only let a reaction's author delete it (WordPress/gutenberg#85415) - Writing flow: Fix Arrow Up and Down getting stuck at the edge of the screen (WordPress/gutenberg#85408) - Try: Run e2e tests in parallel, on one wp-env site per two cores (WordPress/gutenberg#85420) - Raw handling: Keep shortcodes in text inline (WordPress/gutenberg#85795) - Fix: Fixes non-breaking space replacement tooltip (WordPress/gutenberg#85777) - Non-breaking space: Remove non-breaking spaces that would collapse when replaced (WordPress/gutenberg#85873) Props mamaduka. See #66340. Built from https://develop.svn.wordpress.org/trunk@65225 git-svn-id: http://core.svn.wordpress.org/trunk@64374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
See #80405. Companion to #84087 for
@wordpress/components; this PR targetstrunkindependently.What?
Use solid brand highlights for active popup items, with consistent pointer and keyboard states.
Why?
Match WordPress UI's solid brand Button treatment and keep text and icons readable on the highlight.
How?
Share paired WPDS foreground and background tokens through CSS. Active submenu parents use the brand highlight; open parents become neutral when focus moves into the submenu, matching #84087. Disabled items retain a visible focus ring.
CustomSelectControl temporarily replaces custom option colors with brand colors while an option is active and restores them when inactive. The With Custom Colors story demonstrates this supported API. No production whole-option color overrides were found in Gutenberg; BackgroundClipControl uses preview swatches instead. This search does not cover external plugins.
Focus or selection controls the brand fill. Existing menu and Autocomplete pointer handlers update that active state, so the shared hover selector is removed. URLInput now selects suggestions on pointer movement without moving focus from the input; LinkControl inherits that behavior. Block style labels inherit their menu item's color. Button's generic hover accent excludes menu-item and option roles, so inactive popup items keep their resting colors.
Opening-focus and navigation changes are covered by #85486 and #85487. #85488 adds the matching disabled-item focus cue to
@wordpress/ui. The corner-joining rules are removed.Testing Instructions
Testing Instructions for Keyboard
Verification and limits
Production build, components, block-editor and Storybook typechecks, JS/CSS lint, published dependency checks, changelog validation, and 609 existing tests across 32 files passed on
97c9ae3402c7. The final independent local review found no actionable issues. Chromium checks cover submenu states, disabled focus, custom option colors, themes, WordPress global CSS, block style labels, image-link actions, native URLInput, and LinkControl. Pointer and keyboard changes preserve one active fill and input focus; hovering stale suggestions during a pending search does not leave an invalid active-item reference. No test files or test bodies were added. Button's generic hover accent excludes popup-item roles; ordinary Button hover styling and explicit variant styling remain.Safari, real touch hardware, screen readers, and native Windows high-contrast mode were not tested locally. Editor consumer checks used the integrated Storybook editor; the local wp-env site could not start because Docker address pools were exhausted. The preexisting popup width shift remains in #85831.
Screenshots or screencast
Editor checks after review feedback
Commit
97c9ae3402c7. Integrated Storybook block editor, WordPress global CSS, light theme, LTR, reduced motion. Editor captures are 700 × 440; the block styles capture is cropped to the popup.Commit
cb830dea3bb0. Local Storybook standalone canvas, LTR, reduced motion. Menu captures are 520 × 510, submenus 600 × 250, option controls 520 × 290, and theme examples 520 × 190. Menu and option captures use basic global CSS; theme examples use WordPress global CSS. These are fresh captures of the rebased source.Square option rows and custom colors
CustomSelectControl With Custom Colors. Active options use paired brand colors. Inactive options restore their custom colors, while bold and italic text remain.
FormTokenField Dropdown Selector, after ArrowDown. One suggestion has the brand fill; flush rows have square corners.
Light, dark, and custom themes with WordPress global CSS
MenuItem With Info. Light uses keyboard focus; dark and custom use pointer hover. The custom theme uses primary
#007cbaand background#f5f0e8.Use of AI Tools
Implemented, reviewed, and verified with Codex. I reviewed the changes and remain responsible for them.