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

Form elements do not have sufficient vertical spacing #3042

Closed
HDinger opened this issue Aug 30, 2024 · 4 comments
Closed

Form elements do not have sufficient vertical spacing #3042

HDinger opened this issue Aug 30, 2024 · 4 comments
Assignees
Labels

Comments

@HDinger
Copy link
Contributor

HDinger commented Aug 30, 2024

Steps to reproduce

  • Create a form with many elements
  • Observe the spacing between the elements

Actual behavior

  • The individual fields are very close together, there is only little vertical space between them. That does not look very nice and is also hard for users to scan.
    • The space is not consistent, it is larger, when the field above has a description displayed.
    • The FormControl-spacingWrapper adds a spacing of 8px in between the elements which is not enough imho
Bildschirmfoto 2024-08-30 um 13 50 27
  • It feels like in GitHub the same issue was experienced and "solved" by putting a FormGroup around each individual field to add more spacing (see for example https://github.com/settings/profile)
Bildschirmfoto 2024-08-30 um 13 52 32

Expected behavior

  • In my eyes, it should not be required to put FormGroups around individual elements to make a comparably simply form readable
  • The default spacing between form elements should be larger (e.g 16px).
@camertron
Copy link
Contributor

Thanks for bringing this up @HDinger 😄 If you have time to put together a PR for this, I would be happy to review it. You're right that we shouldn't have to wrap each form field in a group wrapper, although the framework does that automatically. It might be worth removing caption padding and increasing the padding on the group element. Thoughts?

@HDinger
Copy link
Contributor Author

HDinger commented Sep 13, 2024

Hi @camertron I gave it a shot in #3087. I'd be happy to get your review on this. I for now tried to simply increase the space which is given by the FormControl-spacingWrapper because of two reasons:

  1. The spacingWrapper is meant exactly for this case. It used a custom space and I replaced it with a standardized variable.
  2. Groups are not always added automatically. Basically every expample that is in the lookbook does not have a form group, so we cannot rely on the group to take care of the spacing

@mperrotti
Copy link
Contributor

I don't think form elements should project padding/margins. The spacing between form controls should be handled by the layout CSS in whatever context you're rendering the form controls in.

@HDinger
Copy link
Contributor Author

HDinger commented Oct 28, 2024

This can be closed as it is tackled in #3159

@HDinger HDinger closed this as completed Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants