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