-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
UnitControl: Update unit select styles #64712
Conversation
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
@@ -114,7 +115,7 @@ const unitSelectSizes = ( { selectSize = 'default' }: SelectProps ) => { | |||
align-items: center; | |||
|
|||
&:where( :not( :disabled ) ):hover { | |||
box-shadow: inset 0 0 0 | |||
box-shadow: 0 0 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be curious to know the reason for using inset
in the first place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flaky tests detected in af44d19. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10504728508
|
Nice :) I'm curious about where the styling for the unit selector comes from, is it custom? It seems that we could save a little space by removing the padding and the min-width? |
@jameskoster Could you clarify to make sure I'm understanding you correctly? The padding is already the lowest we can go (4px), and a 24px min-width seems reasonable to maintain as a tap target. |
I see, thanks for clarifying!
Personally, an underline for a hover/focus style seems quite foreign in our look & feel, like it comes from a different universe (Google Material). We can consider it separately from this PR if you want to propose it though! |
* UnitControl: Update unit select styles * Add changelog Co-authored-by: mirka <[email protected]> Co-authored-by: ciampo <[email protected]> Co-authored-by: jameskoster <[email protected]>
What?
Makes the following improvements to the UnitControl unit select styles when in the 40px size:
field-sizing: content
so the select can hug the width of the current unit label. This will make the whitespace look more consistent across units. (Consider this a progressive enhancement, because thefield-sizing
property is not implemented in Safari and Firefox yet.)Testing Instructions
See Storybook for UnitControl.
Screenshots or screencast