Skip to content

Commit

Permalink
Merge pull request #21032 from twbs/flexbox-input-group
Browse files Browse the repository at this point in the history
Proper input group sizing and alignment in flexbox mode
  • Loading branch information
mdo authored Oct 28, 2016
2 parents f655343 + 78c9757 commit d23163a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion scss/_input-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@include hover-focus-active {
z-index: 3;
}

@if $enable-flex {
flex: 1;
} @else {
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d23163a

Please sign in to comment.