Skip to content

Commit

Permalink
Fix .btn-group-vertical border radius with dropdown as first element (
Browse files Browse the repository at this point in the history
twbs#40488)

Co-authored-by: Julien Déramond <[email protected]>
  • Loading branch information
tordans and julien-deramond authored May 30, 2024
1 parent 442421b commit 76ed1c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion scss/_button-group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,12 @@
@include border-bottom-radius(0);
}

> .btn ~ .btn,
// The top radius should be 0 if the button is:
// - the "third or more" child
// - the second child and the previous element isn't `.btn-check` (making it the first child visually)
// - part of a btn-group which isn't the first child
> .btn:nth-child(n + 3),
> :not(.btn-check) + .btn,
> .btn-group:not(:first-child) > .btn {
@include border-top-radius(0);
}
Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/5.3/components/button-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,6 @@ Make a set of buttons appear vertically stacked rather than horizontally. **Spli

{{< example >}}
<div class="btn-group-vertical" role="group" aria-label="Vertical button group">
<button type="button" class="btn btn-primary">Button</button>
<button type="button" class="btn btn-primary">Button</button>
<div class="btn-group" role="group">
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
Expand All @@ -206,6 +204,8 @@ Make a set of buttons appear vertically stacked rather than horizontally. **Spli
<li><a class="dropdown-item" href="#">Dropdown link</a></li>
</ul>
</div>
<button type="button" class="btn btn-primary">Button</button>
<button type="button" class="btn btn-primary">Button</button>
<div class="btn-group dropstart" role="group">
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
Expand Down

0 comments on commit 76ed1c6

Please sign in to comment.