— Previously we weren't including the border-width on the computed height, leading to alignment issues.
— New system utilizes three variables (not ideal, but straightforward) for computing these heights. One for the vertical border, one for the line-height/font-size/padding dance, and one to add those together.
— Updates CSS across forms and custom forms to use new sizing. Special note here: form validation icon sizing uses the inner variables because background-image doesn't bleed into borders unless explicit background-clip.
.custom-select {
display: inline-block;
max-width: 100%;
- $select-border-width: ($custom-select-border-width * 2);
- height: calc(#{$input-height} + #{$select-border-width});
+ height: $input-height;
padding: $custom-select-padding-y ($custom-select-padding-x + $custom-select-indicator-padding) $custom-select-padding-y $custom-select-padding-x;
line-height: $custom-select-line-height;
color: $custom-select-color;
select.form-control {
&:not([size]):not([multiple]) {
- $select-border-width: ($border-width * 2);
- height: calc(#{$input-height} + #{$select-border-width});
+ height: $input-height;
}
&:focus::-ms-value {
select.form-control-sm {
&:not([size]):not([multiple]) {
- $select-border-width: ($border-width * 2);
- height: calc(#{$input-height-sm} + #{$select-border-width});
+ height: $input-height-sm;
}
}
select.form-control-lg {
&:not([size]):not([multiple]) {
- $select-border-width: ($border-width * 2);
- height: calc(#{$input-height-lg} + #{$select-border-width});
+ height: $input-height-lg;
}
}
.form-control-danger {
padding-right: ($input-btn-padding-x * 3);
background-repeat: no-repeat;
- background-position: center right ($input-height / 4);
- background-size: ($input-height / 2) ($input-height / 2);
+ background-position: center right ($input-height-inner / 4);
+ background-size: ($input-height-inner / 2) ($input-height-inner / 2);
}
// Form validation states
$input-color-placeholder: $gray-light !default;
-$input-height: (($font-size-base * $input-btn-line-height) + ($input-btn-padding-y * 2)) !default;
-$input-height-lg: (($font-size-lg * $input-btn-line-height-lg) + ($input-btn-padding-y-lg * 2)) !default;
-$input-height-sm: (($font-size-sm * $input-btn-line-height-sm) + ($input-btn-padding-y-sm * 2)) !default;
+$input-height-border: $input-btn-border-width * 2 !default;
+
+$input-height-inner: ($font-size-base * $input-btn-line-height) + ($input-btn-padding-y * 2) !default;
+$input-height: calc(#{$input-height-inner} + #{$input-height-border}) !default;
+
+$input-height-inner-sm: ($font-size-sm * $input-btn-line-height-sm) + ($input-btn-padding-y-sm * 2) !default;
+$input-height-sm: calc(#{$input-height-inner-sm} + #{$input-height-border}) !default;
+
+$input-height-inner-lg: ($font-size-sm * $input-btn-line-height-lg) + ($input-btn-padding-y-lg * 2) !default;
+$input-height-lg: calc(#{$input-height-inner-lg} + #{$input-height-border}) !default;
$input-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s !default;
$custom-select-padding-y: .375rem !default;
$custom-select-padding-x: .75rem !default;
+$custom-select-height: $input-height !default;
$custom-select-indicator-padding: 1rem !default; // Extra padding to account for the presence of the background-image based indicator
$custom-select-line-height: $input-btn-line-height !default;
$custom-select-color: $input-color !default;