Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BorderControl: Fix focus styling #40951

Merged
merged 5 commits into from
May 11, 2022

Conversation

aaronrobertshaw
Copy link
Contributor

Fixes: #40897

What?

Makes the inner component focus styles and border radii consistent.

Why?

The small details matter.

How?

Updated focus styles and border radii including RTL styling.

UnitSelect
  • Fixed RTL border radii
  • Fixed inconsistent focus box-shadow and border
BorderControlDropdown
  • Fixed z-index causing focus styles to be clipped
InputControl's BackdropUI
  • Fixed RTL border radii
  • Fixed focus box-shadow

Testing Instructions

  1. Start up Storybook & visit BorderControl page
    • npm run storybook:dev
  2. Optional: Zoom the page in as far as possible to more clearly see styling changes.
  3. Select the input within the control then tab/shift-tab through the parts of the control, ensuring correct border radii and that the outline looks correct
  4. Switch to RTL mode and repeat the process paying close attention to the border radii

Screenshots or screencast

Screen.Recording.2022-05-10.at.11.25.21.am.mp4

@aaronrobertshaw aaronrobertshaw added [Type] Enhancement A suggestion for improvement. [Feature] UI Components Impacts or related to the UI component system CSS Styling Related to editor and front end styles, CSS-specific issues. labels May 10, 2022
@aaronrobertshaw aaronrobertshaw self-assigned this May 10, 2022
Copy link
Contributor

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work putting up these PRs to fine-tune the UI @aaronrobertshaw! The border radii are looking good to me, but the border width looks slightly inconsistent to me compared to similar components (e.g. InputControl) where the focus style doesn't change the overall size of the field — I was wondering if setting inset will fix it (and / or if the border-width needs to be slightly heavier?)

packages/components/src/border-control/styles.ts Outdated Show resolved Hide resolved
@aaronrobertshaw aaronrobertshaw force-pushed the fix/border-control-focus-styling branch from e776ef4 to 55beb85 Compare May 10, 2022 07:30
@aaronrobertshaw
Copy link
Contributor Author

This PR now reworks the application of borders to the BorderControl's inner components. This allows for simpler focus styles and an inset box shadow for greater consistency with the common UnitControl.

Screen.Recording.2022-05-10.at.6.57.15.pm.mp4

@shaunandrews
Copy link
Contributor

This looks great! Thanks for tackling it. I did notice that the left border radii are different from the rest:

image

@aaronrobertshaw
Copy link
Contributor Author

I did notice that the left border radii are different from the rest:

Nice catch. Thank you.

I missed tweaking the button's border radii after refactoring the styling in ec58f46. That's been fixed now.

Copy link
Contributor

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, thanks for reworking this @aaronrobertshaw, that's looking really solid now! ✨

✅ Works nicely in the editor and the focus style is consistent with the nearby UnitControls
✅ Tested in Storybook that it looks good in RTL mode

2022-05-11 10 22 02

LGTM! 🚀

@aaronrobertshaw aaronrobertshaw merged commit 0ae80c5 into trunk May 11, 2022
@aaronrobertshaw aaronrobertshaw deleted the fix/border-control-focus-styling branch May 11, 2022 00:27
@github-actions github-actions bot added this to the Gutenberg 13.3 milestone May 11, 2022
@ciampo ciampo added the [Package] Components /packages/components label May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] UI Components Impacts or related to the UI component system [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Border Tools: Inconsistent focus borders
4 participants