aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2016-10-27 13:40:55 -0700
committerMark Otto <[email protected]>2016-10-27 13:40:55 -0700
commit259a420d70913cdb97ceeb303985091a7325fffb (patch)
tree603463f9be645409e2c8103dc543cf31ed189b7d
parent93ac9381be198c901fb26b1dbadfef88c66cee58 (diff)
downloadbootstrap-259a420d70913cdb97ceeb303985091a7325fffb.tar.xz
bootstrap-259a420d70913cdb97ceeb303985091a7325fffb.zip
Ensure proper sizing of and alignment of content within input group addons and buttons
Fixes #20927.
-rw-r--r--scss/_input-group.scss15
1 files changed, 14 insertions, 1 deletions
diff --git a/scss/_input-group.scss b/scss/_input-group.scss
index a33f2d303..52f2c13c2 100644
--- a/scss/_input-group.scss
+++ b/scss/_input-group.scss
@@ -24,6 +24,7 @@
@include hover-focus-active {
z-index: 3;
}
+
@if $enable-flex {
flex: 1;
} @else {
@@ -40,7 +41,12 @@
.input-group-addon,
.input-group-btn,
.input-group .form-control {
- @if not $enable-flex {
+ @if $enable-flex {
+ // Vertically centers the content of the addons within the input group
+ display: flex;
+ justify-content: center;
+ flex-direction: column;
+ } @else {
display: table-cell;
}
@@ -158,9 +164,16 @@
// element above the siblings.
> .btn {
position: relative;
+
+ @if $enable-flex {
+ // Vertically stretch the button and center its content
+ flex: 1;
+ }
+
+ .btn {
margin-left: (-$input-btn-border-width);
}
+
// Bring the "active" button to the front
@include hover-focus-active {
z-index: 3;