Skip to content

Commit ea8f6c6

Browse files
ysdsXhmikosR
authored andcommitted
Button group refactoring and fixes (#25395)
1 parent d275096 commit ea8f6c6

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

scss/_button-group.scss

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@
2222
z-index: 1;
2323
}
2424
}
25-
26-
// Prevent double borders when buttons are next to each other
27-
.btn + .btn,
28-
.btn + .btn-group,
29-
.btn-group + .btn,
30-
.btn-group + .btn-group {
31-
margin-left: -$btn-border-width;
32-
}
3325
}
3426

3527
// Optional: Group multiple button groups together for a toolbar
@@ -44,8 +36,10 @@
4436
}
4537

4638
.btn-group {
47-
> .btn:first-child {
48-
margin-left: 0;
39+
// Prevent double borders when buttons are next to each other
40+
> .btn:not(:first-child),
41+
> .btn-group:not(:first-child) {
42+
margin-left: -$btn-border-width;
4943
}
5044

5145
// Reset rounded corners
@@ -119,17 +113,14 @@
119113
align-items: flex-start;
120114
justify-content: center;
121115

122-
.btn,
123-
.btn-group {
116+
> .btn,
117+
> .btn-group {
124118
width: 100%;
125119
}
126120

127-
> .btn + .btn,
128-
> .btn + .btn-group,
129-
> .btn-group + .btn,
130-
> .btn-group + .btn-group {
121+
> .btn:not(:first-child),
122+
> .btn-group:not(:first-child) {
131123
margin-top: -$btn-border-width;
132-
margin-left: 0;
133124
}
134125

135126
// Reset rounded corners

0 commit comments

Comments
 (0)