2012-01-07 19:45:24 +08:00
|
|
|
// Make the div behave like a button
|
2013-05-10 07:26:35 +08:00
|
|
|
.btn-group,
|
|
|
|
.btn-group-vertical {
|
2012-01-07 19:45:24 +08:00
|
|
|
position: relative;
|
2017-01-04 11:22:08 +08:00
|
|
|
display: inline-flex;
|
2012-08-28 03:05:15 +08:00
|
|
|
vertical-align: middle; // match .btn alignment given font-size hack above
|
2014-12-03 06:02:35 +08:00
|
|
|
|
2012-12-21 16:50:28 +08:00
|
|
|
> .btn {
|
2013-03-01 13:19:02 +08:00
|
|
|
position: relative;
|
2018-11-25 19:05:31 +08:00
|
|
|
flex: 1 1 auto;
|
2020-05-02 17:11:24 +08:00
|
|
|
}
|
2014-12-03 06:02:35 +08:00
|
|
|
|
2020-05-02 17:11:24 +08:00
|
|
|
// Bring the hover, focused, and "active" buttons to the front to overlay
|
|
|
|
// the borders properly
|
2020-06-04 21:59:24 +08:00
|
|
|
> .btn-check:checked + .btn,
|
|
|
|
> .btn-check:focus + .btn,
|
2020-05-02 17:11:24 +08:00
|
|
|
> .btn:hover,
|
|
|
|
> .btn:focus,
|
|
|
|
> .btn:active,
|
|
|
|
> .btn.active {
|
|
|
|
z-index: 1;
|
2012-12-21 16:50:28 +08:00
|
|
|
}
|
2013-05-10 07:26:35 +08:00
|
|
|
}
|
|
|
|
|
2012-01-07 19:45:24 +08:00
|
|
|
// Optional: Group multiple button groups together for a toolbar
|
2012-01-06 02:01:42 +08:00
|
|
|
.btn-toolbar {
|
2016-12-22 15:29:16 +08:00
|
|
|
display: flex;
|
2017-01-25 12:43:33 +08:00
|
|
|
flex-wrap: wrap;
|
2016-12-22 15:29:16 +08:00
|
|
|
justify-content: flex-start;
|
2016-12-28 06:36:30 +08:00
|
|
|
|
|
|
|
.input-group {
|
|
|
|
width: auto;
|
|
|
|
}
|
2012-01-06 02:01:42 +08:00
|
|
|
}
|
|
|
|
|
2017-10-23 05:17:28 +08:00
|
|
|
.btn-group {
|
2021-12-16 16:43:30 +08:00
|
|
|
@include border-radius($btn-border-radius);
|
|
|
|
|
2018-11-04 14:50:21 +08:00
|
|
|
// Prevent double borders when buttons are next to each other
|
2022-09-05 03:31:09 +08:00
|
|
|
> :not(.btn-check:first-child) + .btn,
|
|
|
|
> .btn-group:not(:first-child) {
|
2023-03-27 23:34:14 +08:00
|
|
|
margin-left: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list
|
2017-10-23 05:17:28 +08:00
|
|
|
}
|
|
|
|
|
2017-12-27 08:04:11 +08:00
|
|
|
// Reset rounded corners
|
|
|
|
> .btn:not(:last-child):not(.dropdown-toggle),
|
2022-03-25 01:13:11 +08:00
|
|
|
> .btn.dropdown-toggle-split:first-child,
|
2017-12-27 08:04:11 +08:00
|
|
|
> .btn-group:not(:last-child) > .btn {
|
2020-06-26 22:06:20 +08:00
|
|
|
@include border-end-radius(0);
|
2017-10-23 05:17:28 +08:00
|
|
|
}
|
2013-05-04 07:16:26 +08:00
|
|
|
|
2020-06-04 22:48:17 +08:00
|
|
|
// The left 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
|
2020-05-02 17:11:24 +08:00
|
|
|
> .btn:nth-child(n + 3),
|
2020-06-04 22:48:17 +08:00
|
|
|
> :not(.btn-check) + .btn,
|
2017-12-27 08:04:11 +08:00
|
|
|
> .btn-group:not(:first-child) > .btn {
|
2020-06-26 22:06:20 +08:00
|
|
|
@include border-start-radius(0);
|
2017-10-23 05:17:28 +08:00
|
|
|
}
|
|
|
|
}
|
2012-01-29 03:21:39 +08:00
|
|
|
|
2013-08-13 05:03:57 +08:00
|
|
|
// Sizing
|
|
|
|
//
|
|
|
|
// Remix the default button sizing classes into new ones for easier manipulation.
|
|
|
|
|
2014-12-03 06:02:35 +08:00
|
|
|
.btn-group-sm > .btn { @extend .btn-sm; }
|
|
|
|
.btn-group-lg > .btn { @extend .btn-lg; }
|
2013-08-13 05:03:57 +08:00
|
|
|
|
2012-01-07 19:45:24 +08:00
|
|
|
|
2015-04-19 02:15:40 +08:00
|
|
|
//
|
2012-01-07 19:45:24 +08:00
|
|
|
// Split button dropdowns
|
2015-04-19 02:15:40 +08:00
|
|
|
//
|
2012-01-07 19:45:24 +08:00
|
|
|
|
2017-10-28 11:35:33 +08:00
|
|
|
.dropdown-toggle-split {
|
2017-10-19 15:05:07 +08:00
|
|
|
padding-right: $btn-padding-x * .75;
|
|
|
|
padding-left: $btn-padding-x * .75;
|
2016-01-09 05:23:24 +08:00
|
|
|
|
2018-03-13 00:51:00 +08:00
|
|
|
&::after,
|
|
|
|
.dropup &::after,
|
2020-06-26 22:06:20 +08:00
|
|
|
.dropend &::after {
|
2016-05-12 02:36:09 +08:00
|
|
|
margin-left: 0;
|
2016-01-09 05:23:24 +08:00
|
|
|
}
|
2018-03-13 00:51:00 +08:00
|
|
|
|
2020-06-26 22:06:20 +08:00
|
|
|
.dropstart &::before {
|
2018-03-13 00:51:00 +08:00
|
|
|
margin-right: 0;
|
|
|
|
}
|
2012-03-11 05:40:58 +08:00
|
|
|
}
|
2012-01-07 19:45:24 +08:00
|
|
|
|
2016-05-12 02:36:09 +08:00
|
|
|
.btn-sm + .dropdown-toggle-split {
|
2017-10-19 15:05:07 +08:00
|
|
|
padding-right: $btn-padding-x-sm * .75;
|
|
|
|
padding-left: $btn-padding-x-sm * .75;
|
2016-05-12 02:36:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.btn-lg + .dropdown-toggle-split {
|
2017-10-19 15:05:07 +08:00
|
|
|
padding-right: $btn-padding-x-lg * .75;
|
|
|
|
padding-left: $btn-padding-x-lg * .75;
|
2016-05-12 02:36:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-01-13 20:05:34 +08:00
|
|
|
// The clickable button for toggling the menu
|
2017-04-09 07:30:18 +08:00
|
|
|
// Set the same inset shadow as the :active state
|
|
|
|
.btn-group.show .dropdown-toggle {
|
2016-01-10 07:14:36 +08:00
|
|
|
@include box-shadow($btn-active-box-shadow);
|
2013-10-21 08:59:15 +08:00
|
|
|
|
|
|
|
// Show no shadow for `.btn-link` since it has no other button styles.
|
|
|
|
&.btn-link {
|
2014-12-03 06:02:35 +08:00
|
|
|
@include box-shadow(none);
|
2013-10-21 08:59:15 +08:00
|
|
|
}
|
2013-01-13 20:05:34 +08:00
|
|
|
}
|
2012-01-07 19:45:24 +08:00
|
|
|
|
2012-03-23 14:09:31 +08:00
|
|
|
|
2015-04-19 02:15:40 +08:00
|
|
|
//
|
2012-06-20 05:42:46 +08:00
|
|
|
// Vertical button groups
|
2015-04-19 02:15:40 +08:00
|
|
|
//
|
2012-06-20 05:42:46 +08:00
|
|
|
|
2013-08-14 00:59:38 +08:00
|
|
|
.btn-group-vertical {
|
2016-12-22 15:29:16 +08:00
|
|
|
flex-direction: column;
|
|
|
|
align-items: flex-start;
|
2016-12-27 09:18:19 +08:00
|
|
|
justify-content: center;
|
2016-12-22 15:29:16 +08:00
|
|
|
|
2018-11-04 14:50:21 +08:00
|
|
|
> .btn,
|
|
|
|
> .btn-group {
|
2016-12-28 06:36:55 +08:00
|
|
|
width: 100%;
|
2013-08-14 01:24:18 +08:00
|
|
|
}
|
|
|
|
|
2018-11-04 14:50:21 +08:00
|
|
|
> .btn:not(:first-child),
|
|
|
|
> .btn-group:not(:first-child) {
|
2023-03-27 23:34:14 +08:00
|
|
|
margin-top: calc(#{$btn-border-width} * -1); // stylelint-disable-line function-disallowed-list
|
2013-05-10 07:26:35 +08:00
|
|
|
}
|
2013-08-14 00:59:38 +08:00
|
|
|
|
2017-12-27 08:04:11 +08:00
|
|
|
// Reset rounded corners
|
|
|
|
> .btn:not(:last-child):not(.dropdown-toggle),
|
|
|
|
> .btn-group:not(:last-child) > .btn {
|
|
|
|
@include border-bottom-radius(0);
|
2017-08-14 05:55:28 +08:00
|
|
|
}
|
|
|
|
|
2020-11-30 17:09:55 +08:00
|
|
|
> .btn ~ .btn,
|
2017-12-27 08:04:11 +08:00
|
|
|
> .btn-group:not(:first-child) > .btn {
|
2017-08-14 05:55:28 +08:00
|
|
|
@include border-top-radius(0);
|
2013-08-14 00:59:38 +08:00
|
|
|
}
|
|
|
|
}
|