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