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.

Feature request: col-form-label should have optional size classes

See original GitHub issue
  • Operating system and version: Any
  • Browser and version: Any
  • Bootstrap V4

Currently, .col-form-label and two helper classes for sizing .col-form-label-sm and .col-form-label-lg, so that the label can be matched with the form-control’s sizing.

When using a <fieldset> to group related controls in a form-group, one uses the <legend> element to label the group of inputs, and one can use the corresponding class .col-form-legend to style the legend.

Unfortunately there are no helper classes .col-form-legend-sm or .col-form-legend-lg to control the legend text size so that it matches up with the form-control size or other col-form-labels that may be in the same form.

I have tried applying the .col-form-label-sm (or -lg) classes to the <legend> along with .col-form-legend, but it does not work, due to the order of the definition of the CSS rules which make .col-form-legend’s font size overrule .col-form-label-sm

Maybe just simply moving the .col-form-legend CSS rule before the .col-form-label-{size} rules would suffice?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
mdocommented, Dec 2, 2017

For backwards comparability, would it be good to specify both class names?

Not necessary—we’re still at beta, so we can break things.

0reactions
tmorehousecommented, Dec 2, 2017

.col-form-legend is now gone altogether (and form docs updated)

For backwards comparability, would it be good to specify both class names?

.col-form-label,
.col-form-legend {
 /* ... */
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Layout · Bootstrap v5.1
They provide basic grouping of labels, controls, optional form text, ... By adding gutter modifier classes, you can have control over the gutter...
Read more >
Forms - Bootstrap - University of Houston
When you need to place plain text next to a form label within a form, use the .form-control-static class on a <p> ....
Read more >
Layout - React-Bootstrap
Every group of form fields should reside in a <Form> element. ... for grouping of labels, controls, optional help text, and form validation...
Read more >
Forms · Bootstrap
Bootstrap's form controls expand on our Rebooted form styles with classes. Use these classes to opt into their customized displays for a more ......
Read more >
optional - CSS: Cascading Style Sheets - MDN Web Docs
The :optional CSS pseudo-class represents any , , or element that does not have the required attribute set on it.
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