badges.less 2.12 KB
Newer Older
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
/* ------------------------------------------------------------------------------
*
*  # Badges component
*
*  Overrides for badges bootstrap component
*
*  Version: 1.2
*  Latest update: Mar 10, 2016
*
* ---------------------------------------------------------------------------- */


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

.badge {
    padding: 2px 6px 1px 6px;
    font-size: 10px;
    letter-spacing: 0.1px;
    vertical-align: baseline;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 100px;

    // Quick fix for badges in buttons
    .btn & {
        top: 0;
    }
    .btn-xs & {
        padding: 2px 6px 1px 6px;
    }

    // Account for badges in navs
    .list-group-item.active > &,
    .nav-pills > .active > a > &,
    .nav-tabs-solid > .active > a > &,
    .nav-tabs[class*=bg-] > li > a > & {
        color: @badge-active-color;
        background-color: @badge-active-bg;
        border-color: @badge-active-bg;
    }  
    .nav-pills > li > a > & {
        margin-left: 0;

        &.position-right {
            margin-left: @element-horizontal-spacing;
        }
    }
}


// Contextual variations
// -------------------------

// Default
.badge-default {
    background-color: @label-default-bg;
    border-color: @label-default-bg;
}

// Primary
.badge-primary {
    background-color: @label-primary-bg;
    border-color: @label-primary-bg;
}

// Success
.badge-success {
    background-color: @label-success-bg;
    border-color: @label-success-bg;
}

// Info
.badge-info {
    background-color: @label-info-bg;
    border-color: @label-info-bg;
}

// Warning
.badge-warning {
    background-color: @label-warning-bg;
    border-color: @label-warning-bg;
}

// Danger
.badge-danger {
    background-color: @label-danger-bg;
    border-color: @label-danger-bg;
}


// Flat labels style
// -------------------------

.badge-flat {
    background-color: transparent;
    border-width: 2px;
    padding: 1px 5px 0 5px;

    // Remove background color and shadow on hover
    &[href] {
        &:hover,
        &:focus {
            background-color: transparent;
            .box-shadow(none);
        }
    }
}