-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Feature request: col-form-label should have optional size classes #24917
Comments
PR #24932 adds in two size classes for horizontal form-group legend elements |
Why do the PR if this would've sufficed? I'd prefer the simpler rearrangement vs a whole new suite of modifier classes. |
There are a few differences between label and legend, when I checked the latest .col-form-label {
padding-top: calc(#{$input-padding-y} + #{$input-border-width});
padding-bottom: calc(#{$input-padding-y} + #{$input-border-width});
margin-bottom: 0; // Override the `<label>` default
line-height: $input-line-height;
}
.col-form-legend {
padding-top: $input-padding-y;
padding-bottom: $input-padding-y;
margin-bottom: 0;
font-size: $font-size-base;
} If they were identical styling, it would be just a matter of moving the base |
The question is, why couldn't legend and label use the same classes ( |
Yeah, I feel that. Just tested it—can you make that change? Let's drop |
Maybe there's something more in the log as to why it needed to be another class? |
OK, I'll make some tweaks |
It appears |
For backwards comparability, would it be good to specify both class names? .col-form-label,
.col-form-legend {
/* ... */
} |
Not necessary—we're still at beta, so we can break things. |
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 othercol-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?The text was updated successfully, but these errors were encountered: