Components: Align legacy form control focus rings with WPDS#80417
Components: Align legacy form control focus rings with WPDS#80417ciampo wants to merge 4 commits into
Conversation
|
Size Change: +131 B (0%) Total Size: 7.73 MB 📦 View Changed
|
There was a problem hiding this comment.
Trying out a different approach that doesn't cut off the focus ring, but still lets SelectControl shrink inside the flex row despite white-space: nowrap
|
Flaky tests detected in 1b83fe9. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/29617798981
|
|
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. |
9700694 to
1b83fe9
Compare
Part of #80412.
What?
Aligns the shared focus ring used by legacy
InputBasecontrols with@wordpress/uifor Phase 0 of #80412. It also prevents the DataViews filter operatorSelectControlfrom clipping the new outset ring.Why?
Legacy form controls need to look as close as possible to their
@wordpress/uireplacements before consumer migrations begin. Their current adjacent border and box-shadow treatment differs from the UI outset ring.Why the old style used box-shadow
Gutenberg's older focus convention combined a 1px border with a 0.5px shadow to produce the specified 1.5px stroke (#54394, #54398), when rounded outlines were not yet reliable across supported browsers. It was a consistency technique, not an
InputControlrequirement. Because box-shadows are not visible in Windows High Contrast Mode, the legacy style also needed a transparent outline fallback (#50772). The WPDS outline now provides the intended outset shape and forced-colors behavior directly.How?
InputBasefocus treatment from Emotion to package Sass and appliesoutset-ring__focus(), using the same--wpds-border-width-focusand--wpds-color-stroke-focustokens and generated fallbacks as@wordpress/ui.overflow: hiddenwithmin-width: 0preserves its flex sizing while allowing the ring to paint outside.Testing Instructions
Run:
In Storybook and relevant editor surfaces, focus these controls and compare their outset rings with their
@wordpress/uiequivalents:InputControl,SelectControl,CustomSelectControl(legacy wrapper and v2 implementation)NumberControl,SearchControl,UnitControl,RangeControl(including its input field),AnglePickerControl,TreeSelectColorPicker,ColorPalette,CustomGradientPicker,GradientPicker,TimePicker,DateTimePicker,PaletteEdit,FontSizePicker,BorderControl,QueryControlsValidatedInputControl,ValidatedNumberControl,ValidatedSelectControl,ValidatedCustomSelectControl,ValidatedRangeControlCheck the behavior-sensitive cases:
UnitControlunit selector, suppresses the surrounding input ring.TimePickerhour/minute fields and customizedPaletteEditname field have the correct ring shape without clipping.Testing Instructions for Keyboard
Screenshots or screencast
Here are a few examlpes of the change that is being applied
Use of AI Tools
Codex was used to inspect existing focus-ring patterns and history, audit affected consumers, implement the shared Sass change and clipping fix, run verification, and draft this pull request. The resulting diff and generated CSS were reviewed manually.