button-groups.less 2.95 KB
Newer Older
Luis Gangas committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
/* ------------------------------------------------------------------------------
*
*  # Button group component
*
*  Overrides for button group bootstrap component
*
*  Version: 1.1
*  Latest update: Oct 20, 2015
*
* ---------------------------------------------------------------------------- */


// Base
// -------------------------

// Prevent double borders when buttons are next to each other
.btn-group {
    .btn + .btn,
    .btn + .btn-group,
    .btn-group + .btn,
    .btn-group + .btn-group {
        margin-left: 1px;
    }

    // In default button border is darker than bg
    .btn + .btn-default,
    .btn-default + .btn-group,
    .btn-group + .btn-default {
        margin-left: -1px;
    }
}

// Group multiple button groups together for a toolbar
.btn-toolbar {
    font-size: 0;
    
    .btn-group,
    .input-group {
        float: none;
    }
}

// Remove left border radius in multiple buttons
.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {
    .border-left-radius(0);
}


// Sizing
// -------------------------

// Since we use overrides in buttons.less, sizing needs to be
// dublicated here
.btn-group-xlg > .btn {
    &:extend(.btn-xlg);
}
.btn-group-lg > .btn {
    &:extend(.btn-lg);
}
.btn-group-sm > .btn {
    &:extend(.btn-sm);
}
.btn-group-xs > .btn {
    &:extend(.btn-xs);
}


// Caret button size in split buttons
// ----------------------

// Default button and button group
.btn-group > .btn + .dropdown-toggle {
    padding-left: (@padding-base-horizontal - 3);
    padding-right: (@padding-base-horizontal - 3);
}

// XLarge button and button group
.btn-group > .btn-xlg + .dropdown-toggle,
.btn-group-xlg > .btn + .dropdown-toggle {
    padding-left: (@padding-xlarge-horizontal - 3);
    padding-right: (@padding-xlarge-horizontal - 3);
}

// Large button and button group
.btn-group > .btn-lg + .dropdown-toggle,
.btn-group-lg > .btn + .dropdown-toggle {
    padding-left: (@padding-large-horizontal - 3);
    padding-right: (@padding-large-horizontal - 3);
}

// Small button and button group
.btn-group > .btn-sm + .dropdown-toggle,
.btn-group-sm > .btn + .dropdown-toggle {
    padding-left: (@padding-small-horizontal - 3);
    padding-right: (@padding-small-horizontal - 3);
}

// Mini button and button group
.btn-group > .btn-xs + .dropdown-toggle,
.btn-group-xs > .btn + .dropdown-toggle {
    padding-left: (@padding-xs-horizontal - 3);
    padding-right: (@padding-xs-horizontal - 3);
}


// The clickable button for toggling the menu
// ----------------------

.btn-group.open .dropdown-toggle {
    .box-shadow(0 0 0 100px fade(#000, 10%) inset);

    &.btn-default {
        .box-shadow(0 0 0 100px fade(#000, 3%) inset);
    }
}


// Justified button groups
// ----------------------

.btn-group-justified {
    > .btn + .btn,
    > .btn-group + .btn-group > .btn {
        border-left-color: fade(#fff, 20%);
    }

    > .btn + .btn-default,
    > .btn-group + .btn-group > .btn-default {
        border-left-width: 0;
    }
}