diff options
| author | Martijn Cuppens <[email protected]> | 2020-03-31 20:02:57 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-03-31 20:02:57 +0200 |
| commit | df707cd7272f9165dda895f08bdd15d093d96a25 (patch) | |
| tree | 81c2effffc72b50164668054f2f0db7931bb02ab /scss | |
| parent | a0c2a29a8dbb563fb84591522c6412063df70d59 (diff) | |
| download | bootstrap-df707cd7272f9165dda895f08bdd15d093d96a25.tar.xz bootstrap-df707cd7272f9165dda895f08bdd15d093d96a25.zip | |
Require `.form-label` classes on form labels (#30476)
Diffstat (limited to 'scss')
| -rw-r--r-- | scss/_button-group.scss | 2 | ||||
| -rw-r--r-- | scss/_list-group.scss | 1 | ||||
| -rw-r--r-- | scss/_reboot.scss | 1 | ||||
| -rw-r--r-- | scss/_variables.scss | 6 | ||||
| -rw-r--r-- | scss/forms/_form-check.scss | 1 | ||||
| -rw-r--r-- | scss/forms/_input-group.scss | 1 | ||||
| -rw-r--r-- | scss/forms/_labels.scss | 13 |
7 files changed, 17 insertions, 8 deletions
diff --git a/scss/_button-group.scss b/scss/_button-group.scss index e486d469d..e3d2e4cc4 100644 --- a/scss/_button-group.scss +++ b/scss/_button-group.scss @@ -149,8 +149,6 @@ .btn-group-toggle { > .btn, > .btn-group > .btn { - margin-bottom: 0; // Override default `<label>` value - input[type="radio"], input[type="checkbox"] { position: absolute; diff --git a/scss/_list-group.scss b/scss/_list-group.scss index 99ec43be8..fe97ce526 100644 --- a/scss/_list-group.scss +++ b/scss/_list-group.scss @@ -46,7 +46,6 @@ position: relative; display: block; padding: $list-group-item-padding-y $list-group-item-padding-x; - margin-bottom: 0; // for <label> variations color: $list-group-color; text-decoration: if($link-decoration == none, null, none); background-color: $list-group-bg; diff --git a/scss/_reboot.scss b/scss/_reboot.scss index cf48352d2..d3d487189 100644 --- a/scss/_reboot.scss +++ b/scss/_reboot.scss @@ -381,7 +381,6 @@ th { label { display: inline-block; // 1 - margin-bottom: $label-margin-bottom; } // Remove the default `border-radius` that macOS Chrome adds. diff --git a/scss/_variables.scss b/scss/_variables.scss index 9312c0be4..638945eb2 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -557,7 +557,11 @@ $btn-transition: color .15s ease-in-out, background-color .15s ease // Forms -$label-margin-bottom: .5rem !default; +$form-label-margin-bottom: .5rem !default; +$form-label-font-size: null !default; +$form-label-font-style: null !default; +$form-label-font-weight: null !default; +$form-label-color: null !default; $input-padding-y: $input-btn-padding-y !default; $input-padding-x: $input-btn-padding-x !default; diff --git a/scss/forms/_form-check.scss b/scss/forms/_form-check.scss index 03ae57385..3666b6ab4 100644 --- a/scss/forms/_form-check.scss +++ b/scss/forms/_form-check.scss @@ -99,7 +99,6 @@ } .form-check-label { - margin-bottom: 0; color: $form-check-label-color; cursor: $form-check-label-cursor; } diff --git a/scss/forms/_input-group.scss b/scss/forms/_input-group.scss index 878cb83d6..c8e86cebe 100644 --- a/scss/forms/_input-group.scss +++ b/scss/forms/_input-group.scss @@ -63,7 +63,6 @@ display: flex; align-items: center; padding: $input-padding-y $input-padding-x; - margin-bottom: 0; // Allow use of <label> elements by overriding our default margin-bottom @include font-size($input-font-size); // Match inputs font-weight: $font-weight-normal; line-height: $input-line-height; diff --git a/scss/forms/_labels.scss b/scss/forms/_labels.scss index a3184b7d7..39ecafcd2 100644 --- a/scss/forms/_labels.scss +++ b/scss/forms/_labels.scss @@ -2,14 +2,25 @@ // Labels // +.form-label { + margin-bottom: $form-label-margin-bottom; + @include font-size($form-label-font-size); + font-style: $form-label-font-style; + font-weight: $form-label-font-weight; + color: $form-label-color; +} + // For use with horizontal and inline forms, when you need the label (or legend) // text to align with the form controls. .col-form-label { padding-top: add($input-padding-y, $input-border-width); padding-bottom: add($input-padding-y, $input-border-width); - margin-bottom: 0; // Override the `<label>/<legend>` default + margin-bottom: 0; // Override the `<legend>` default @include font-size(inherit); // Override the `<legend>` default + font-style: $form-label-font-style; + font-weight: $form-label-font-weight; line-height: $input-line-height; + color: $form-label-color; } .col-form-label-lg { |
