Skip to content

Commit a1d8a84

Browse files
committed
fix: button group elevation issue
1 parent e3dcff1 commit a1d8a84

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

scss/_button-group.scss

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.btn-group,
55
.btn-group-vertical {
66
position: relative;
7+
z-index: 1;
78
display: inline-flex;
89
vertical-align: middle; // match .btn alignment given font-size hack above
910

@@ -14,14 +15,19 @@
1415
// Bring the hover, focused, and "active" buttons to the front to overlay
1516
// the borders properly
1617
@include hover() {
17-
z-index: 1;
18+
z-index: 2;
1819
}
1920
&:focus,
2021
&:active,
2122
&.active {
22-
z-index: 1;
23+
z-index: 2;
2324
}
2425
}
26+
27+
.btn-group,
28+
.btn-group-vertical {
29+
z-index: auto;
30+
}
2531
}
2632

2733
// Optional: Group multiple button groups together for a toolbar
@@ -123,12 +129,15 @@
123129

124130
// The clickable button for toggling the menu
125131
// Set the same inset shadow as the :active state
126-
.btn-group.show .dropdown-toggle {
127-
@include box-shadow($btn-active-box-shadow);
128-
129-
// Show no shadow for `.btn-link` since it has no other button styles.
130-
&.btn-link {
131-
@include box-shadow(none);
132+
.btn-group.show {
133+
z-index: 3;
134+
.dropdown-toggle {
135+
@include box-shadow($btn-active-box-shadow);
136+
137+
// Show no shadow for `.btn-link` since it has no other button styles.
138+
&.btn-link {
139+
@include box-shadow(none);
140+
}
132141
}
133142
}
134143

scss/_buttons.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
@include button-size($btn-padding-y, $btn-padding-x, $btn-font-size, $btn-line-height, $btn-border-radius);
2020
@include transition($btn-transition);
2121
&:not([class*="ghost"]):not([class*="link"]):not([class*="outline"]):not([class*="transparent"]) {
22-
@include elevation(1);
22+
@include elevation(1, false, true);
2323
}
2424

2525
@include hover() {

0 commit comments

Comments
 (0)