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