aboutsummaryrefslogtreecommitdiff
path: root/scss/_button-group.scss
diff options
context:
space:
mode:
authorBobby <[email protected]>2024-08-16 20:47:33 -0400
committerGitHub <[email protected]>2024-08-16 20:47:33 -0400
commit6b28433d9cfde435be8ec2bd6cf91e6324d08865 (patch)
tree8343c27b8b95ff5639233e81cf157f92e5688466 /scss/_button-group.scss
parentd53094ec16ba385faae2973ddee648698b32ab24 (diff)
parent048f56f51460df75e92a2f7b472e1c56baeb68f7 (diff)
downloadbootstrap-main.tar.xz
bootstrap-main.zip
Merge branch 'twbs:main' into mainHEADmain
Diffstat (limited to 'scss/_button-group.scss')
-rw-r--r--scss/_button-group.scss16
1 files changed, 12 insertions, 4 deletions
diff --git a/scss/_button-group.scss b/scss/_button-group.scss
index 13aa0569a..dcd2a858e 100644
--- a/scss/_button-group.scss
+++ b/scss/_button-group.scss
@@ -34,14 +34,17 @@
}
.btn-group {
+ @include border-radius($btn-border-radius);
+
// Prevent double borders when buttons are next to each other
- > .btn:not(:first-child),
+ > :not(.btn-check:first-child) + .btn,
> .btn-group:not(:first-child) {
- margin-left: -$btn-border-width;
+ margin-left: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list
}
// Reset rounded corners
> .btn:not(:last-child):not(.dropdown-toggle),
+ > .btn.dropdown-toggle-split:first-child,
> .btn-group:not(:last-child) > .btn {
@include border-end-radius(0);
}
@@ -123,7 +126,7 @@
> .btn:not(:first-child),
> .btn-group:not(:first-child) {
- margin-top: -$btn-border-width;
+ margin-top: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list
}
// Reset rounded corners
@@ -132,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);
}