-
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
InputControl: Tighten gap between input and prefix/suffix #64908
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. |
Flaky tests detected in 38c94c4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10617819996
|
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.
Code looks good and the change makes sense to me visually, given the provided rationale 👍 🚀
- Tighten gap between the main control and the prefix/suffix slot for the following components ([#64908](https://github.com/WordPress/gutenberg/pull/64908)). | ||
- `InputControl` | ||
- `NumberControl` | ||
- `SelectControl` | ||
- `TreeSelect` | ||
- `UnitControl` |
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.
Are these all the affected components? I can see some other components that use InputControl
with prefix/suffix will be affected by it (for example, ColorPicker
)
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.
Oh right, I was thinking in terms of "components where a consumer can add a prefix/suffix".
Good that you pointed that out, because it's unclear whether this blanket change is desirable in use cases like ColorPicker. It looks fine in hex mode, but one could say it slightly decreases legibility in the RGB/HSL modes. (cc @WordPress/gutenberg-design)
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.
The above looks good to me.
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.
Nice follow up to the recent horizontal padding reduction.
I'm going to go ahead and back the padding for BorderControl/BorderBoxControl since it doesn't look quite right with the tightened value (39e1ea0). Let me know if you disagree.
|
…64908) * InputControl: Tighten padding between input and prefix/suffix * Add changelog * BorderControl: Add back padding * Add more components to changelog Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
May unblock #64842
What?
Reduces the gap between the prefix/suffix slots and the actual input, from 8px to 4px.
Why?
We are looking for ways to be more economical with space in the context of #64842, but also the current specs seem to use these gap values anyway.
Testing Instructions
Look at the "With Prefix", "With Suffix", and "With Icon or Control" stories for InputControl. Check both the 40px and
compact
size variants.Screenshots or screencast
Compact size
Default size
@WordPress/gutenberg-design FYI it is possible to have different gap values for when the prefix/suffix is an icon vs. an interactive control. No strong opinion, but there may be an argument for keeping the gaps for controls wider because a focus ring will be involved.