1 // Make the div behave like a button
6 vertical-align: middle; // match .btn alignment given font-size hack above
13 // Bring the hover, focused, and "active" buttons to the front to overlay
14 // the borders properly
15 > .btn-check:checked + .btn,
16 > .btn-check:focus + .btn,
25 // Optional: Group multiple button groups together for a toolbar
29 justify-content: flex-start;
37 @include border-radius($btn-border-radius);
39 // Prevent double borders when buttons are next to each other
40 > :not(.btn-check:first-child) + .btn,
41 > .btn-group:not(:first-child) {
42 margin-left: -$btn-border-width;
45 // Reset rounded corners
46 > .btn:not(:last-child):not(.dropdown-toggle),
47 > .btn.dropdown-toggle-split:first-child,
48 > .btn-group:not(:last-child) > .btn {
49 @include border-end-radius(0);
52 // The left radius should be 0 if the button is:
53 // - the "third or more" child
54 // - the second child and the previous element isn't `.btn-check` (making it the first child visually)
55 // - part of a btn-group which isn't the first child
56 > .btn:nth-child(n + 3),
57 > :not(.btn-check) + .btn,
58 > .btn-group:not(:first-child) > .btn {
59 @include border-start-radius(0);
65 // Remix the default button sizing classes into new ones for easier manipulation.
67 .btn-group-sm > .btn { @extend .btn-sm; }
68 .btn-group-lg > .btn { @extend .btn-lg; }
72 // Split button dropdowns
75 .dropdown-toggle-split {
76 padding-right: $btn-padding-x * .75;
77 padding-left: $btn-padding-x * .75;
85 .dropstart &::before {
90 .btn-sm + .dropdown-toggle-split {
91 padding-right: $btn-padding-x-sm * .75;
92 padding-left: $btn-padding-x-sm * .75;
95 .btn-lg + .dropdown-toggle-split {
96 padding-right: $btn-padding-x-lg * .75;
97 padding-left: $btn-padding-x-lg * .75;
101 // The clickable button for toggling the menu
102 // Set the same inset shadow as the :active state
103 .btn-group.show .dropdown-toggle {
104 @include box-shadow($btn-active-box-shadow);
106 // Show no shadow for `.btn-link` since it has no other button styles.
108 @include box-shadow(none);
114 // Vertical button groups
117 .btn-group-vertical {
118 flex-direction: column;
119 align-items: flex-start;
120 justify-content: center;
127 > .btn:not(:first-child),
128 > .btn-group:not(:first-child) {
129 margin-top: -$btn-border-width;
132 // Reset rounded corners
133 > .btn:not(:last-child):not(.dropdown-toggle),
134 > .btn-group:not(:last-child) > .btn {
135 @include border-bottom-radius(0);
139 > .btn-group:not(:first-child) > .btn {
140 @include border-top-radius(0);