Skip to content

Commit 76ed1c6

Browse files
Fix .btn-group-vertical border radius with dropdown as first element (#40488)
Co-authored-by: Julien Déramond <[email protected]>
1 parent 442421b commit 76ed1c6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Diff for: scss/_button-group.scss

+6-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,12 @@
135135
@include border-bottom-radius(0);
136136
}
137137

138-
> .btn ~ .btn,
138+
// The top radius should be 0 if the button is:
139+
// - the "third or more" child
140+
// - the second child and the previous element isn't `.btn-check` (making it the first child visually)
141+
// - part of a btn-group which isn't the first child
142+
> .btn:nth-child(n + 3),
143+
> :not(.btn-check) + .btn,
139144
> .btn-group:not(:first-child) > .btn {
140145
@include border-top-radius(0);
141146
}

Diff for: site/content/docs/5.3/components/button-group.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,6 @@ Make a set of buttons appear vertically stacked rather than horizontally. **Spli
195195

196196
{{< example >}}
197197
<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
198-
<button type="button" class="btn btn-primary">Button</button>
199-
<button type="button" class="btn btn-primary">Button</button>
200198
<div class="btn-group" role="group">
201199
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
202200
Dropdown
@@ -206,6 +204,8 @@ Make a set of buttons appear vertically stacked rather than horizontally. **Spli
206204
<li><a class="dropdown-item" href="#">Dropdown link</a></li>
207205
</ul>
208206
</div>
207+
<button type="button" class="btn btn-primary">Button</button>
208+
<button type="button" class="btn btn-primary">Button</button>
209209
<div class="btn-group dropstart" role="group">
210210
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
211211
Dropdown

0 commit comments

Comments
 (0)