]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Ensure proper sizing of and alignment of content within input group addons and buttons
authorMark Otto <markdotto@gmail.com>
Thu, 27 Oct 2016 20:40:55 +0000 (13:40 -0700)
committerMark Otto <markdotto@gmail.com>
Thu, 27 Oct 2016 20:40:55 +0000 (13:40 -0700)
Fixes #20927.

scss/_input-group.scss

index a33f2d3036e025212a40fa424e40daf759df4720..52f2c13c2213a8223fab59b9da6e32bdabbefa2b 100644 (file)
@@ -24,6 +24,7 @@
     @include hover-focus-active {
       z-index: 3;
     }
+
     @if $enable-flex {
       flex: 1;
     } @else {
 .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;
   }
 
   // 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;