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