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

Text field error spacing #2399

Merged
merged 14 commits into from
Sep 26, 2024
Merged

Text field error spacing #2399

merged 14 commits into from
Sep 26, 2024

Conversation

mollykreis
Copy link
Contributor

@mollykreis mollykreis commented Sep 18, 2024

Pull Request

🤨 Rationale

Fixes #2090

There are a few problems with the spacing in the text field:

  1. The spacing between the error icon and the right edge of the component is 8px rather than 4px.
  2. The spacing between the "parts" of the component is 8px rather than 4px. This is spacing such as the inner input to the error icon, the inner input to the action slot buttons, and the error icon to the action slot buttons.
  3. The spacing between the right edge of the component and the content within the component (error icon, action slot buttons, or right edge of the inner input) is measured from the border rather than including the border.
  4. The spacing between the left edge of the component and the start slot icon is 8px rather than 4px.
  5. The spacing between the left edge of the component and the content within the component (start slot icon or left edge of the inner input).

This PR addresses problems 1 & 2 above, but it does not address problems 3-5 because these should be addressed across all components (select, combobox, number field, etc) in order to avoid creating misalignments of text across components. Therefore, I created #2400.

👩‍💻 Implementation

  • Updated the gap used in the text-field to be small padding (4px) rather than medium padding (8px), which addressed problems 1 & 2.
    • In order to keep the input 8px from the left side of the text field, with the new 4px gap, I also added 4px to the left padding of the .root element.
    • Similarly, I added a 4px margin on the right of the slotted start icon to keep the icon 8px from the input.

🧪 Testing

  • Manually tested in storybook
  • Inspected the chromatic diffs

✅ Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@mollykreis
Copy link
Contributor Author

@m-akinc, can you buddy this PR for me?

@mollykreis mollykreis marked this pull request as ready for review September 19, 2024 19:29
@mollykreis mollykreis merged commit 81ac3b9 into main Sep 26, 2024
13 checks passed
@mollykreis mollykreis deleted the text-field-error-spacing branch September 26, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error icon is incorrectly spaced in nimble-text-field
4 participants