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

InputControl: Tighten gap between input and prefix/suffix #64908

Merged
merged 4 commits into from
Aug 30, 2024

Conversation

mirka
Copy link
Member

@mirka mirka commented Aug 29, 2024

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

Before After
InputControl with prefix/suffix, before InputControl with prefix/suffix, after

Default size

Before After
InputControl with prefix/suffix, 40px, before InputControl with prefix/suffix, 40px, after

@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.

@mirka mirka added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components labels Aug 29, 2024
@mirka mirka self-assigned this Aug 29, 2024
@mirka mirka requested a review from ajitbohra as a code owner August 29, 2024 15:09
Copy link

github-actions bot commented Aug 29, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

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>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@mirka mirka added the Needs Design Feedback Needs general design feedback. label Aug 29, 2024
@mirka mirka requested review from a team August 29, 2024 15:13
Copy link

Flaky tests detected in 38c94c4.
Some 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.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10617819996
📝 Reported issues:

Copy link
Member

@tyxla tyxla left a 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 👍 🚀

Comment on lines +27 to +32
- 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`
Copy link
Member

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)

Copy link
Member Author

@mirka mirka Aug 29, 2024

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)

ColorPicker, hex mode ColorPicker, RGB mode

Copy link
Contributor

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.

Copy link
Contributor

@jameskoster jameskoster left a 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.

@mirka
Copy link
Member Author

mirka commented Aug 30, 2024

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.

Tighter Trunk
BorderControl, after BorderControl, before

@mirka mirka enabled auto-merge (squash) August 30, 2024 15:08
@mirka mirka merged commit 4782b48 into trunk Aug 30, 2024
61 checks passed
@mirka mirka deleted the tighten-input-prefix-padding branch August 30, 2024 15:39
@github-actions github-actions bot added this to the Gutenberg 19.2 milestone Aug 30, 2024
bph pushed a commit to bph/gutenberg that referenced this pull request Aug 31, 2024
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Feedback Needs general design feedback. [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants