Skip to content

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

@tmorehouse

Description

@tmorehouse
  • 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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions