question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Form spacing inconsistencies

See original GitHub issue

Detailed description

Describe in detail the issue you’re having.

Fieldsets and form items should have consistent spacing within a form. Currently Fieldsets have a margin-bottom of $carbon--spacing-07 (https://github.com/IBM/carbon-components/blob/master/src/components/form/_form.scss#L20) but form-item doesn’t have any margin-bottom meaning we have to manually add it. The demos on the Carbon site have a manual 2rem margin-bottom added to form-item.

Secondly according to the guidelines, the spacing should be 24px/1.5rem which would be $carbon--spacing-06.

Is this issue related to a specific component?

Form

What did you expect to happen? What happened instead? What would you like to see changed?

Form items and fieldsets have consistent spacing (either they both have it or neither have it) and follow the recommended guidelines outlined on the Carbon site. https://www.carbondesignsystem.com/components/form/style#recommended

What browser are you working in?

Chrome

What version of the Carbon Design System are you using?

v10.1.0

What offering/product do you work on? Any pressing ship or release dates we should be aware of?

Watson Health Design Pattern & Asset Library (PAL)

Steps to reproduce the issue

  1. Inspect the form demo on the carbon site.
  2. note the margin bottom is not part of the component styles
  3. note the margin bottom value does not align with the recommended values

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
emyarodcommented, May 2, 2019

that might be true, but somewhere along the way something caused breakage because I remember components like the Slider being broken for quite some time. will need to take a look at the form/component history to see why that might have happened as well

1reaction
emyarodcommented, Apr 30, 2019

hi @elizabethsjudd thanks for reporting this! IIRC the v9 .bx--form-item class had a 2rem bottom margin applied to it, but this rule was never brought to v10.

I believe this is also related to https://github.com/IBM/carbon-components-react/issues/1681. I found that many of our React components which contained nested inputs would have the 2rem bottom margins incorrectly applied. For example, <Slider>, which contains a text input, would use React <TextInput> rather than just <input type="text"> with Carbon classes added. Since our <TextInput> has been wrapped in the .bx--form-item class since v7 (or earlier), this was causing visual bugs in components which contained nested input controls (refs: https://github.com/IBM/carbon-components-react/pull/1683#issuecomment-452748293 https://github.com/IBM/carbon-components-react/pull/2085)

I am on board with adding the bottom margin back into the form styles, but I think this change should go hand in hand with requiring explicit usage of <FormItem> (and fieldset) instead of hard coding that wrapper into our components so that we don’t introduce some visual bugs (and so we can go back to directly importing our React components within compound components instead of tracking changes manually). what are your thoughts on this @asudoh?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Uneven Spacing in MS Word - Blinn College
The Modern Language Association (MLA) requires that academic papers be evenly double-spaced throughout the document, with no “extra space above or below the ......
Read more >
Form spacing inconsistencies · Issue #2343 · carbon ... - GitHub
Fieldsets and form items should have consistent spacing within a form. Currently Fieldsets have a margin-bottom of $carbon--spacing-07 ...
Read more >
Creating a fillable form - formatting/spacing errors.
In trying to create a form using a template, I encounter one major problem: spacing.
Read more >
Spacing Fields in the second line is inconsistent with the first line
I created a new form. I added the first field which was the "name" preset, then shrunk the name field and added a...
Read more >
Three ways to expose formatting inconsistencies in a Word ...
Often, the fix is easy. You can select each paragraph and press [Ctrl]+[Spacebar] to remove direct formatting leaving only styles in place.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found