mirror of https://github.com/twbs/bootstrap.git
Ensure proper sizing of and alignment of content within input group addons and buttons
Fixes #20927.
This commit is contained in:
parent
93ac9381be
commit
259a420d70
|
@ -24,6 +24,7 @@
|
||||||
@include hover-focus-active {
|
@include hover-focus-active {
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@if $enable-flex {
|
@if $enable-flex {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
} @else {
|
} @else {
|
||||||
|
@ -40,7 +41,12 @@
|
||||||
.input-group-addon,
|
.input-group-addon,
|
||||||
.input-group-btn,
|
.input-group-btn,
|
||||||
.input-group .form-control {
|
.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;
|
display: table-cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,9 +164,16 @@
|
||||||
// element above the siblings.
|
// element above the siblings.
|
||||||
> .btn {
|
> .btn {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
@if $enable-flex {
|
||||||
|
// Vertically stretch the button and center its content
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
+ .btn {
|
+ .btn {
|
||||||
margin-left: (-$input-btn-border-width);
|
margin-left: (-$input-btn-border-width);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bring the "active" button to the front
|
// Bring the "active" button to the front
|
||||||
@include hover-focus-active {
|
@include hover-focus-active {
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
|
|
Loading…
Reference in New Issue