From 259a420d70913cdb97ceeb303985091a7325fffb Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 27 Oct 2016 13:40:55 -0700 Subject: [PATCH 1/2] Ensure proper sizing of and alignment of content within input group addons and buttons Fixes #20927. --- scss/_input-group.scss | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scss/_input-group.scss b/scss/_input-group.scss index a33f2d3036e0..52f2c13c2213 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; From 78c9757236e5c4fc4b2e7fe35f92156b6ae7e649 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 27 Oct 2016 13:46:16 -0700 Subject: [PATCH 2/2] property order --- scss/_input-group.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scss/_input-group.scss b/scss/_input-group.scss index 52f2c13c2213..7eef23a9dd09 100644 --- a/scss/_input-group.scss +++ b/scss/_input-group.scss @@ -44,8 +44,8 @@ @if $enable-flex { // Vertically centers the content of the addons within the input group display: flex; - justify-content: center; flex-direction: column; + justify-content: center; } @else { display: table-cell; }