// // Button groups // -------------------------------------------------- // Make the div behave like a button .btn-group { position: relative; font-size: 0; // remove as part 1 of font-size inline-block hack white-space: nowrap; // prevent buttons from wrapping when in tight spaces (e.g., the table on the tests page) @include ie7-restore-left-whitespace(); } // Space out series of button groups .btn-group + .btn-group { margin-left: 5px; } // Optional: Group multiple button groups together for a toolbar .btn-toolbar { font-size: 0; // Hack to remove whitespace that results from using inline-block margin-top: $baseLineHeight / 2; margin-bottom: $baseLineHeight / 2; .btn-group { display: inline-block; @include ie7-inline-block(); } .btn-blue + .btn-blue, .btn-group + .btn-blue, .btn-blue + .btn-group { margin-left: 5px; } } // Float them, remove border radius, then re-add to first and last elements .btn-group > .btn-blue { position: relative; @include border-radius(0px), } .btn-group > .btn-blue + .btn-blue { margin-left: -1px; } .btn-group > .btn-blue, .btn-group > .dropdown-menu { font-size: $baseFontSize; // redeclare as part 2 of font-size inline-block hack } // Reset fonts for other sizes .btn-group > .btn-mini { font-size: 11px; } .btn-group > .btn-small { font-size: 12px; } .btn-group > .btn-large { font-size: 16px; } // 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 .btn-group > .btn-blue:first-child { margin-left: 0; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; } // Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it .btn-group > .btn-blue:last-child, .btn-group > .dropdown-toggle { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; } // Reset corners for large buttons .btn-group > .btn-blue.large:first-child { margin-left: 0; -webkit-border-top-left-radius: 6px; -moz-border-radius-topleft: 6px; border-top-left-radius: 6px; -webkit-border-bottom-left-radius: 6px; -moz-border-radius-bottomleft: 6px; border-bottom-left-radius: 6px; } .btn-group > .btn-blue.large:last-child, .btn-group > .large.dropdown-toggle { -webkit-border-top-right-radius: 6px; -moz-border-radius-topright: 6px; border-top-right-radius: 6px; -webkit-border-bottom-right-radius: 6px; -moz-border-radius-bottomright: 6px; border-bottom-right-radius: 6px; } // On hover/focus/active, bring the proper btn to front .btn-group > .btn-blue:hover, .btn-group > .btn-blue:focus, .btn-group > .btn-blue:active, .btn-group > .btn-blue.active { z-index: 2; } // On active and open, don't show outline .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } // Split button dropdowns // ---------------------- .btn-group.open { .btn.dropdown-toggle { background-color: $blueDark; color: $white; } .btn.dropdown-toggle.caret{ @include transition (border 1s, color, 1s); border-top-color: $white; border-bottom-color: $white; } } // Reposition the caret .btn .caret { margin-top: 8px; margin-left: 0; } // Carets in other button sizes .btn-mini .caret, .btn-small .caret, .btn-large .caret { margin-top: 6px; } .btn-large .caret { border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; } // Upside down carets for .dropup .dropup .btn-large .caret { border-bottom: 5px solid $black; border-top: 0; } // Account for other colors .btn-blue { .caret { border-top-color: $white; border-bottom-color: $white; } }