Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/4.0/layout/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,5 @@ $zindex-tooltip: 1070 !default;
```

Background elements—like the backdrops that allow click-dismissing—tend to reside on a lower `z-index`s, while navigation and popovers utilize higher `z-index`s to ensure they overlay surrounding content.

Additionally, the `button-group`, `input-group`, `list-group`, and `pagination` components make use of setting `z-index` to `1` or `2` in order to ensure that the borders of the _active_ element correctly appear "above" their sibling elements.
4 changes: 2 additions & 2 deletions scss/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
// Bring the hover, focused, and "active" buttons to the front to overlay
// the borders properly
@include hover {
z-index: 2;
z-index: 1;
}
&:focus,
&:active,
&.active {
z-index: 2;
z-index: 1;
}
}

Expand Down
10 changes: 5 additions & 5 deletions scss/_input-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// Ensure that the input is always above the *appended* addon button for
// proper border colors.
position: relative;
z-index: 2;
z-index: 1;
flex: 1 1 auto;
// Add width 1% and flex-basis auto to ensure that button will not wrap out
// the column. Applies to IE Edge+ and Firefox. Chrome does not require this.
Expand All @@ -23,7 +23,7 @@

// Bring the "active" form control to the front
@include hover-focus-active {
z-index: 3;
z-index: 2;
}
}
}
Expand Down Expand Up @@ -150,7 +150,7 @@

// Bring the "active" button to the front
@include hover-focus-active {
z-index: 3;
z-index: 2;
}
}

Expand All @@ -168,7 +168,7 @@
&:not(:first-child) {
> .btn,
> .btn-group {
z-index: 2;
z-index: 1;
// remove nagative margin ($input-btn-border-width) to solve overlapping issue with button.
margin-left: 0;

Expand All @@ -179,7 +179,7 @@

// Because specificity
@include hover-focus-active {
z-index: 3;
z-index: 2;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion scss/_list-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

// Include both here for `<a>`s and `<button>`s
&.active {
z-index: 2; // Place active items above their siblings for proper border styling
z-index: 1; // Place active items above their siblings for proper border styling
color: $list-group-active-color;
background-color: $list-group-active-bg;
border-color: $list-group-active-border-color;
Expand Down
2 changes: 1 addition & 1 deletion scss/_pagination.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}

&.active .page-link {
z-index: 2;
z-index: 1;
color: $pagination-active-color;
background-color: $pagination-active-bg;
border-color: $pagination-active-border-color;
Expand Down