aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2016-10-27 21:23:48 -0700
committerGitHub <[email protected]>2016-10-27 21:23:48 -0700
commitd23163a48393774ebd3c7ac7da4251d8b1c193f1 (patch)
tree65428ae7bbd07c5c831130ba5d231062d2153336
parentf655343ac9d2b7d4a094feb74824d638073492c5 (diff)
parent78c9757236e5c4fc4b2e7fe35f92156b6ae7e649 (diff)
downloadbootstrap-d23163a48393774ebd3c7ac7da4251d8b1c193f1.tar.xz
bootstrap-d23163a48393774ebd3c7ac7da4251d8b1c193f1.zip
Merge pull request #21032 from twbs/flexbox-input-group
Proper input group sizing and alignment in flexbox mode
-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..7eef23a9d 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;
+ flex-direction: column;
+ justify-content: center;
+ } @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;