aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2016-12-25 14:35:57 -0800
committerMark Otto <[email protected]>2016-12-25 15:48:44 -0800
commit96986bb4a3d0dcea3bc5f17234a42a77a0d1756e (patch)
tree48315ba8e56a75799d66960b4a05d6a2adaf7552
parent04d48ba5049d38db9f367442372128f7202cc9b1 (diff)
downloadbootstrap-96986bb4a3d0dcea3bc5f17234a42a77a0d1756e.tar.xz
bootstrap-96986bb4a3d0dcea3bc5f17234a42a77a0d1756e.zip
Use calc() on .col-form-label padding calculations
Fixes #21135. There's a height mismatch here because we're setting padding on the labels, while inputs get padding *and* a top+bottom border. This now uses calc to determine the exact height needed to match labels to inputs.
-rw-r--r--scss/_forms.scss12
1 files changed, 6 insertions, 6 deletions
diff --git a/scss/_forms.scss b/scss/_forms.scss
index 29d294424..8063da7a9 100644
--- a/scss/_forms.scss
+++ b/scss/_forms.scss
@@ -95,20 +95,20 @@ select.form-control {
// For use with horizontal and inline forms, when you need the label text to
// align with the form controls.
.col-form-label {
- padding-top: $input-padding-y;
- padding-bottom: $input-padding-y;
+ padding-top: calc(#{$input-padding-y} - #{$input-btn-border-width} * 2);
+ padding-bottom: calc(#{$input-padding-y} - #{$input-btn-border-width} * 2);
margin-bottom: 0; // Override the `<label>` default
}
.col-form-label-lg {
- padding-top: $input-padding-y-lg;
- padding-bottom: $input-padding-y-lg;
+ padding-top: calc(#{$input-padding-y-lg} - #{$input-btn-border-width} * 2);
+ padding-bottom: calc(#{$input-padding-y-lg} - #{$input-btn-border-width} * 2);
font-size: $font-size-lg;
}
.col-form-label-sm {
- padding-top: $input-padding-y-sm;
- padding-bottom: $input-padding-y-sm;
+ padding-top: calc(#{$input-padding-y-sm} - #{$input-btn-border-width} * 2);
+ padding-bottom: calc(#{$input-padding-y-sm} - #{$input-btn-border-width} * 2);
font-size: $font-size-sm;
}