Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #25039
Closed
Open
Issue created Dec 19, 2017 by Administrator@rootContributor

.form-groups seem arbitrary and unnecessarily complex.

Created by: danielniccoli

I found myself being confused every time I look something up in the form docs and today I decided to spent some time to figure out why: The concept of .form-groups adds another layer of complexity that isn't necessary. Using .form-group seems or is mostly arbitrary.

The .form-group class is the easiest way to add some structure to forms. Its only purpose is to provide margin-bottom around a label and control pairing. As a bonus, since it’s a class you can use it with <fieldset>s, <div>s, or nearly any other element.

They are used in the majority of form examples in the docs, like the "more complex layout" under Form Rows.

However …
If you remove the .form-group from the first row (Email, Password) it doesn't make a difference.
If you remove the .form-group from the second and third row (Address, Address 2) it just looks broken.
If you remove the .form-group from Horizontal Forms it just looks broken.
This example doesn't even use them and adding them doesn't change its style.

So basically, using .form-group on most forms is mandatory, otherwise it just looks like bad styling or even broken. When it's not mandatory, it doesn't matter whether you add it or not, the form looks the same. In other words: Adding .form-group to any form where it's not already present, doesn't change its appearance anyway.

My suggestion is to remove .form-group altogether and provide the margin-bottom around a label-control pair by default, as seen in this example. Further control of margin can be achieved using the Spacing Utilities. This would de-bloat both, forms and docs and make them easier to understand conceptually.

Assignee
Assign to
Time tracking