info@53: //
info@53: // Button groups
info@53: // --------------------------------------------------
info@53: 
info@53: // Make the div behave like a button
info@53: .btn-group,
info@53: .btn-group-vertical {
info@53:   position: relative;
info@53:   display: inline-block;
info@53:   vertical-align: middle; // match .btn alignment given font-size hack above
info@53:   > .btn {
info@53:     position: relative;
info@53:     float: left;
info@53:     // Bring the "active" button to the front
info@53:     &:hover,
info@53:     &:focus,
info@53:     &:active,
info@53:     &.active {
info@53:       z-index: 2;
info@53:     }
info@53:     &:focus {
info@53:       // Remove focus outline when dropdown JS adds it after closing the menu
info@53:       outline: none;
info@53:     }
info@53:   }
info@53: }
info@53: 
info@53: // Prevent double borders when buttons are next to each other
info@53: .btn-group {
info@53:   .btn + .btn,
info@53:   .btn + .btn-group,
info@53:   .btn-group + .btn,
info@53:   .btn-group + .btn-group {
info@53:     margin-left: -1px;
info@53:   }
info@53: }
info@53: 
info@53: // Optional: Group multiple button groups together for a toolbar
info@53: .btn-toolbar {
info@53:   .clearfix();
info@53: 
info@53:   .btn-group {
info@53:     float: left;
info@53:   }
info@53:   // Space out series of button groups
info@53:   > .btn,
info@53:   > .btn-group {
info@53:     + .btn,
info@53:     + .btn-group {
info@53:       margin-left: 5px;
info@53:     }
info@53:   }
info@53: }
info@53: 
info@53: .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
info@53:   border-radius: 0;
info@53: }
info@53: 
info@53: // 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
info@53: .btn-group > .btn:first-child {
info@53:   margin-left: 0;
info@53:   &:not(:last-child):not(.dropdown-toggle) {
info@53:     .border-right-radius(0);
info@53:   }
info@53: }
info@53: // Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
info@53: .btn-group > .btn:last-child:not(:first-child),
info@53: .btn-group > .dropdown-toggle:not(:first-child) {
info@53:   .border-left-radius(0);
info@53: }
info@53: 
info@53: // Custom edits for including btn-groups within btn-groups (useful for including dropdown buttons within a btn-group)
info@53: .btn-group > .btn-group {
info@53:   float: left;
info@53: }
info@53: .btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {
info@53:   border-radius: 0;
info@53: }
info@53: .btn-group > .btn-group:first-child {
info@53:   > .btn:last-child,
info@53:   > .dropdown-toggle {
info@53:     .border-right-radius(0);
info@53:   }
info@53: }
info@53: .btn-group > .btn-group:last-child > .btn:first-child {
info@53:   .border-left-radius(0);
info@53: }
info@53: 
info@53: // On active and open, don't show outline
info@53: .btn-group .dropdown-toggle:active,
info@53: .btn-group.open .dropdown-toggle {
info@53:   outline: 0;
info@53: }
info@53: 
info@53: 
info@53: // Sizing
info@53: //
info@53: // Remix the default button sizing classes into new ones for easier manipulation.
info@53: 
info@53: .btn-group-xs > .btn { .btn-xs(); }
info@53: .btn-group-sm > .btn { .btn-sm(); }
info@53: .btn-group-lg > .btn { .btn-lg(); }
info@53: 
info@53: 
info@53: // Split button dropdowns
info@53: // ----------------------
info@53: 
info@53: // Give the line between buttons some depth
info@53: .btn-group > .btn + .dropdown-toggle {
info@53:   padding-left: 8px;
info@53:   padding-right: 8px;
info@53: }
info@53: .btn-group > .btn-lg + .dropdown-toggle {
info@53:   padding-left: 12px;
info@53:   padding-right: 12px;
info@53: }
info@53: 
info@53: // The clickable button for toggling the menu
info@53: // Remove the gradient and set the same inset shadow as the :active state
info@53: .btn-group.open .dropdown-toggle {
info@53:   .box-shadow(inset 0 3px 5px rgba(0,0,0,.125));
info@53: 
info@53:   // Show no shadow for `.btn-link` since it has no other button styles.
info@53:   &.btn-link {
info@53:     .box-shadow(none);
info@53:   }
info@53: }
info@53: 
info@53: 
info@53: // Reposition the caret
info@53: .btn .caret {
info@53:   margin-left: 0;
info@53: }
info@53: // Carets in other button sizes
info@53: .btn-lg .caret {
info@53:   border-width: @caret-width-large @caret-width-large 0;
info@53:   border-bottom-width: 0;
info@53: }
info@53: // Upside down carets for .dropup
info@53: .dropup .btn-lg .caret {
info@53:   border-width: 0 @caret-width-large @caret-width-large;
info@53: }
info@53: 
info@53: 
info@53: // Vertical button groups
info@53: // ----------------------
info@53: 
info@53: .btn-group-vertical {
info@53:   > .btn,
info@53:   > .btn-group,
info@53:   > .btn-group > .btn {
info@53:     display: block;
info@53:     float: none;
info@53:     width: 100%;
info@53:     max-width: 100%;
info@53:   }
info@53: 
info@53:   // Clear floats so dropdown menus can be properly placed
info@53:   > .btn-group {
info@53:     .clearfix();
info@53:     > .btn {
info@53:       float: none;
info@53:     }
info@53:   }
info@53: 
info@53:   > .btn + .btn,
info@53:   > .btn + .btn-group,
info@53:   > .btn-group + .btn,
info@53:   > .btn-group + .btn-group {
info@53:     margin-top: -1px;
info@53:     margin-left: 0;
info@53:   }
info@53: }
info@53: 
info@53: .btn-group-vertical > .btn {
info@53:   &:not(:first-child):not(:last-child) {
info@53:     border-radius: 0;
info@53:   }
info@53:   &:first-child:not(:last-child) {
info@53:     border-top-right-radius: @border-radius-base;
info@53:     .border-bottom-radius(0);
info@53:   }
info@53:   &:last-child:not(:first-child) {
info@53:     border-bottom-left-radius: @border-radius-base;
info@53:     .border-top-radius(0);
info@53:   }
info@53: }
info@53: .btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {
info@53:   border-radius: 0;
info@53: }
info@53: .btn-group-vertical > .btn-group:first-child {
info@53:   > .btn:last-child,
info@53:   > .dropdown-toggle {
info@53:     .border-bottom-radius(0);
info@53:   }
info@53: }
info@53: .btn-group-vertical > .btn-group:last-child > .btn:first-child {
info@53:   .border-top-radius(0);
info@53: }
info@53: 
info@53: 
info@53: 
info@53: // Justified button groups
info@53: // ----------------------
info@53: 
info@53: .btn-group-justified {
info@53:   display: table;
info@53:   width: 100%;
info@53:   table-layout: fixed;
info@53:   border-collapse: separate;
info@53:   > .btn,
info@53:   > .btn-group {
info@53:     float: none;
info@53:     display: table-cell;
info@53:     width: 1%;
info@53:   }
info@53:   > .btn-group .btn {
info@53:     width: 100%;
info@53:   }
info@53: }
info@53: 
info@53: 
info@53: // Checkbox and radio options
info@53: [data-toggle="buttons"] > .btn > input[type="radio"],
info@53: [data-toggle="buttons"] > .btn > input[type="checkbox"] {
info@53:   display: none;
info@53: }