2016-02-06 20:28:18 +00:00
|
|
|
// scss-lint:disable QualifyingElement
|
|
|
|
|
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;
|
2012-09-12 23:37:41 +00:00
|
|
|
display: inline-block;
|
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;
|
2012-12-21 08:50:28 +00:00
|
|
|
float: left;
|
2014-12-02 22:02:35 +00:00
|
|
|
|
2013-03-01 05:19:02 +00:00
|
|
|
// Bring the "active" button to the front
|
2013-07-29 21:53:55 +00:00
|
|
|
&:focus,
|
2013-08-05 06:27:15 +00:00
|
|
|
&:active,
|
|
|
|
&.active {
|
2013-03-01 05:19:02 +00:00
|
|
|
z-index: 2;
|
|
|
|
}
|
2015-01-01 09:05:01 +00:00
|
|
|
@include hover {
|
|
|
|
z-index: 2;
|
|
|
|
}
|
2012-12-21 08:50:28 +00:00
|
|
|
}
|
2012-01-07 11:45:24 +00:00
|
|
|
}
|
|
|
|
|
2013-05-09 23:26:35 +00:00
|
|
|
// Prevent double borders when buttons are next to each other
|
2013-08-13 16:59:38 +00:00
|
|
|
.btn-group {
|
|
|
|
.btn + .btn,
|
|
|
|
.btn + .btn-group,
|
|
|
|
.btn-group + .btn,
|
|
|
|
.btn-group + .btn-group {
|
2015-12-07 10:07:35 +00:00
|
|
|
margin-left: -$input-btn-border-width;
|
2013-08-13 16:59:38 +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-01-07 00:41:37 +00:00
|
|
|
margin-left: -$btn-toolbar-margin; // Offset the first child's margin
|
2014-12-02 22:02:35 +00:00
|
|
|
@include clearfix();
|
2013-02-05 08:49:54 +00:00
|
|
|
|
2013-12-15 00:03:21 +00:00
|
|
|
.btn-group,
|
|
|
|
.input-group {
|
2012-12-21 08:50:28 +00:00
|
|
|
float: left;
|
|
|
|
}
|
2014-12-02 22:02:35 +00:00
|
|
|
|
2013-07-21 12:03:59 +00:00
|
|
|
> .btn,
|
2013-12-15 00:03:21 +00:00
|
|
|
> .btn-group,
|
|
|
|
> .input-group {
|
2016-01-07 00:41:37 +00:00
|
|
|
margin-left: $btn-toolbar-margin;
|
2012-08-18 23:50:26 +00:00
|
|
|
}
|
2012-01-05 18:01:42 +00:00
|
|
|
}
|
|
|
|
|
2013-05-09 23:26:35 +00:00
|
|
|
.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
|
2012-10-01 06:11:54 +00:00
|
|
|
border-radius: 0;
|
2012-01-05 18:01:42 +00:00
|
|
|
}
|
2013-03-01 03:34:02 +00:00
|
|
|
|
2012-01-07 11:45:24 +00:00
|
|
|
// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match
|
2012-04-03 05:37:58 +00:00
|
|
|
.btn-group > .btn:first-child {
|
2012-01-07 11:45:24 +00:00
|
|
|
margin-left: 0;
|
2014-12-02 22:02:35 +00:00
|
|
|
|
2013-05-09 23:26:35 +00:00
|
|
|
&:not(:last-child):not(.dropdown-toggle) {
|
2014-12-02 22:02:35 +00:00
|
|
|
@include border-right-radius(0);
|
2013-05-09 23:26:35 +00:00
|
|
|
}
|
2012-01-07 11:45:24 +00:00
|
|
|
}
|
2012-04-23 17:06:35 +00:00
|
|
|
// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
|
2013-05-09 23:26:35 +00:00
|
|
|
.btn-group > .btn:last-child:not(:first-child),
|
|
|
|
.btn-group > .dropdown-toggle:not(:first-child) {
|
2014-12-02 22:02:35 +00:00
|
|
|
@include border-left-radius(0);
|
2012-01-07 11:45:24 +00:00
|
|
|
}
|
|
|
|
|
2013-05-03 23:16:26 +00:00
|
|
|
// Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group)
|
|
|
|
.btn-group > .btn-group {
|
|
|
|
float: left;
|
|
|
|
}
|
2013-05-09 23:26:35 +00:00
|
|
|
.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
|
2013-05-03 23:16:26 +00:00
|
|
|
border-radius: 0;
|
|
|
|
}
|
2014-12-03 16:44:35 +00:00
|
|
|
.btn-group > .btn-group:first-child:not(:last-child) {
|
2013-07-07 05:07:03 +00:00
|
|
|
> .btn:last-child,
|
|
|
|
> .dropdown-toggle {
|
2014-12-02 22:02:35 +00:00
|
|
|
@include border-right-radius(0);
|
2013-07-07 05:07:03 +00:00
|
|
|
}
|
2013-05-03 23:16:26 +00:00
|
|
|
}
|
2014-12-03 16:44:35 +00:00
|
|
|
.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
|
2014-12-02 22:02:35 +00:00
|
|
|
@include border-left-radius(0);
|
2013-05-03 23:16:26 +00:00
|
|
|
}
|
|
|
|
|
2012-01-28 19:21:39 +00:00
|
|
|
// On active and open, don't show outline
|
|
|
|
.btn-group .dropdown-toggle:active,
|
|
|
|
.btn-group.open .dropdown-toggle {
|
|
|
|
outline: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
// Give the line between buttons some depth
|
2012-07-30 19:52:44 +00:00
|
|
|
.btn-group > .btn + .dropdown-toggle {
|
2016-01-07 00:41:37 +00:00
|
|
|
padding-right: $split-btn-dropdown-toggle-padding-x;
|
|
|
|
padding-left: $split-btn-dropdown-toggle-padding-x;
|
2012-01-07 11:45:24 +00:00
|
|
|
}
|
2013-08-04 04:39:57 +00:00
|
|
|
.btn-group > .btn-lg + .dropdown-toggle {
|
2016-01-07 00:41:37 +00:00
|
|
|
padding-right: $split-btn-lg-dropdown-toggle-padding-x;
|
|
|
|
padding-left: $split-btn-lg-dropdown-toggle-padding-x;
|
2012-03-10 21:40:58 +00:00
|
|
|
}
|
2012-01-07 11:45:24 +00:00
|
|
|
|
2013-01-13 12:05:34 +00:00
|
|
|
// The clickable button for toggling the menu
|
|
|
|
// Remove the gradient and set the same inset shadow as the :active state
|
|
|
|
.btn-group.open .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
|
|
|
|
2012-01-07 11:45:24 +00:00
|
|
|
// Reposition the caret
|
|
|
|
.btn .caret {
|
|
|
|
margin-left: 0;
|
|
|
|
}
|
2012-03-10 21:40:58 +00:00
|
|
|
// Carets in other button sizes
|
2013-08-04 04:39:57 +00:00
|
|
|
.btn-lg .caret {
|
2015-06-22 23:33:17 +00:00
|
|
|
border-width: $caret-width-lg $caret-width-lg 0;
|
2013-08-18 12:13:48 +00:00
|
|
|
border-bottom-width: 0;
|
2012-03-23 07:37:15 +00:00
|
|
|
}
|
|
|
|
// Upside down carets for .dropup
|
2013-08-04 04:39:57 +00:00
|
|
|
.dropup .btn-lg .caret {
|
2015-06-22 23:33:17 +00:00
|
|
|
border-width: 0 $caret-width-lg $caret-width-lg;
|
2012-03-10 21:40:58 +00:00
|
|
|
}
|
2012-01-28 03:49:56 +00:00
|
|
|
|
2012-01-07 11:45:24 +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 {
|
2013-08-13 17:24:18 +00:00
|
|
|
> .btn,
|
2013-11-15 16:17:40 +00:00
|
|
|
> .btn-group,
|
|
|
|
> .btn-group > .btn {
|
2013-08-13 17:24:18 +00:00
|
|
|
display: block;
|
|
|
|
float: none;
|
|
|
|
width: 100%;
|
|
|
|
max-width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Clear floats so dropdown menus can be properly placed
|
|
|
|
> .btn-group {
|
2014-12-02 22:02:35 +00:00
|
|
|
@include clearfix();
|
|
|
|
|
2013-08-13 17:24:18 +00:00
|
|
|
> .btn {
|
|
|
|
float: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .btn + .btn,
|
|
|
|
> .btn + .btn-group,
|
|
|
|
> .btn-group + .btn,
|
|
|
|
> .btn-group + .btn-group {
|
2015-12-07 10:07:35 +00:00
|
|
|
margin-top: -$input-btn-border-width;
|
2013-08-13 16:59:38 +00:00
|
|
|
margin-left: 0;
|
2013-05-09 23:26:35 +00:00
|
|
|
}
|
|
|
|
}
|
2013-08-13 16:59:38 +00:00
|
|
|
|
|
|
|
.btn-group-vertical > .btn {
|
2013-07-07 05:07:03 +00:00
|
|
|
&:not(:first-child):not(:last-child) {
|
|
|
|
border-radius: 0;
|
|
|
|
}
|
2013-08-05 00:29:01 +00:00
|
|
|
&:first-child:not(:last-child) {
|
2014-12-02 22:02:35 +00:00
|
|
|
@include border-bottom-radius(0);
|
2013-07-07 05:07:03 +00:00
|
|
|
}
|
2013-08-05 00:29:01 +00:00
|
|
|
&:last-child:not(:first-child) {
|
2014-12-02 22:02:35 +00:00
|
|
|
@include border-top-radius(0);
|
2013-07-07 05:07:03 +00:00
|
|
|
}
|
2012-06-19 21:42:46 +00:00
|
|
|
}
|
2013-08-13 16:59:38 +00:00
|
|
|
.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
|
|
|
|
border-radius: 0;
|
|
|
|
}
|
2013-11-15 16:48:24 +00:00
|
|
|
.btn-group-vertical > .btn-group:first-child:not(:last-child) {
|
2013-08-13 16:59:38 +00:00
|
|
|
> .btn:last-child,
|
|
|
|
> .dropdown-toggle {
|
2014-12-02 22:02:35 +00:00
|
|
|
@include border-bottom-radius(0);
|
2013-08-13 16:59:38 +00:00
|
|
|
}
|
|
|
|
}
|
2013-11-15 16:48:24 +00:00
|
|
|
.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {
|
2014-12-02 22:02:35 +00:00
|
|
|
@include border-top-radius(0);
|
2013-08-13 16:59:38 +00:00
|
|
|
}
|
|
|
|
|
2013-02-05 08:30:03 +00:00
|
|
|
|
2013-03-16 19:34:07 +00:00
|
|
|
// Checkbox and radio options
|
2014-03-07 07:50:55 +00:00
|
|
|
//
|
|
|
|
// In order to support the browser's form validation feedback, powered by the
|
2014-09-07 20:45:54 +00:00
|
|
|
// `required` attribute, we have to "hide" the inputs via `clip`. We cannot use
|
|
|
|
// `display: none;` or `visibility: hidden;` as that also hides the popover.
|
|
|
|
// Simply visually hiding the inputs via `opacity` would leave them clickable in
|
|
|
|
// certain cases which is prevented by using `clip` and `pointer-events`.
|
2014-03-07 07:50:55 +00:00
|
|
|
// This way, we ensure a DOM element is visible to position the popover from.
|
|
|
|
//
|
2014-09-07 20:45:54 +00:00
|
|
|
// See https://github.com/twbs/bootstrap/pull/12794 and
|
|
|
|
// https://github.com/twbs/bootstrap/pull/14559 for more information.
|
2014-03-07 07:50:55 +00:00
|
|
|
|
2014-07-06 23:48:41 +00:00
|
|
|
[data-toggle="buttons"] {
|
|
|
|
> .btn,
|
|
|
|
> .btn-group > .btn {
|
|
|
|
input[type="radio"],
|
|
|
|
input[type="checkbox"] {
|
|
|
|
position: absolute;
|
2014-09-07 20:45:54 +00:00
|
|
|
clip: rect(0,0,0,0);
|
|
|
|
pointer-events: none;
|
2014-07-06 23:48:41 +00:00
|
|
|
}
|
|
|
|
}
|
2013-03-16 19:34:07 +00:00
|
|
|
}
|