1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-19 06:18:22 +01:00

Drop .label component. Instead, just use .badge because fuck dupe code and stuff.

This commit is contained in:
Mark Otto 2012-12-19 21:18:32 -08:00
parent 85971ff3e8
commit c6cc1b1a1d
3 changed files with 4 additions and 44 deletions

View File

@ -4521,7 +4521,6 @@ a.thumbnail:hover {
list-style: none; list-style: none;
} }
.label,
.badge { .badge {
display: inline-block; display: inline-block;
padding: 2px 4px; padding: 2px 4px;
@ -4533,87 +4532,64 @@ a.thumbnail:hover {
white-space: nowrap; white-space: nowrap;
vertical-align: baseline; vertical-align: baseline;
background-color: #999999; background-color: #999999;
}
.label {
border-radius: 3px; border-radius: 3px;
} }
.badge {
padding-right: 9px;
padding-left: 9px;
border-radius: 9px;
}
.label:empty,
.badge:empty { .badge:empty {
display: none; display: none;
} }
a.label:hover,
a.badge:hover { a.badge:hover {
color: #fff; color: #fff;
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
} }
.label-danger,
.badge-danger { .badge-danger {
background-color: #b94a48; background-color: #b94a48;
} }
.label-danger[href],
.badge-danger[href] { .badge-danger[href] {
background-color: #953b39; background-color: #953b39;
} }
.label-warning,
.badge-warning { .badge-warning {
background-color: #f89406; background-color: #f89406;
} }
.label-warning[href],
.badge-warning[href] { .badge-warning[href] {
background-color: #c67605; background-color: #c67605;
} }
.label-success,
.badge-success { .badge-success {
background-color: #468847; background-color: #468847;
} }
.label-success[href],
.badge-success[href] { .badge-success[href] {
background-color: #356635; background-color: #356635;
} }
.label-info,
.badge-info { .badge-info {
background-color: #3a87ad; background-color: #3a87ad;
} }
.label-info[href],
.badge-info[href] { .badge-info[href] {
background-color: #2d6987; background-color: #2d6987;
} }
.label-inverse,
.badge-inverse { .badge-inverse {
background-color: #333333; background-color: #333333;
} }
.label-inverse[href],
.badge-inverse[href] { .badge-inverse[href] {
background-color: #1a1a1a; background-color: #1a1a1a;
} }
.btn .label,
.btn .badge { .btn .badge {
position: relative; position: relative;
top: -1px; top: -1px;
} }
.btn-mini .label,
.btn-mini .badge { .btn-mini .badge {
top: 0; top: 0;
} }

View File

@ -4,7 +4,6 @@
// Base classes // Base classes
.label,
.badge { .badge {
display: inline-block; display: inline-block;
padding: 2px 4px; padding: 2px 4px;
@ -16,29 +15,17 @@
white-space: nowrap; white-space: nowrap;
text-shadow: 0 -1px 0 rgba(0,0,0,.25); text-shadow: 0 -1px 0 rgba(0,0,0,.25);
background-color: @grayLight; background-color: @grayLight;
}
// Set unique padding and border-radii
.label {
border-radius: 3px; border-radius: 3px;
}
.badge {
padding-left: 9px;
padding-right: 9px;
border-radius: 9px;
}
// Empty labels/badges collapse // Empty labels/badges collapse
.label,
.badge {
&:empty { &:empty {
display: none; display: none;
} }
} }
// Hover state, but only for links // Hover state, but only for links
a { a.badge {
&.label:hover, &:hover {
&.badge:hover {
color: #fff; color: #fff;
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
@ -47,7 +34,6 @@ a {
// Colors // Colors
// Only give background-color difference to links (and to simplify, we don't qualifty with `a` but [href] attribute) // Only give background-color difference to links (and to simplify, we don't qualifty with `a` but [href] attribute)
.label,
.badge { .badge {
// Important (red) // Important (red)
&-danger { background-color: @state-error-text; } &-danger { background-color: @state-error-text; }
@ -68,14 +54,12 @@ a {
// Quick fix for labels/badges in buttons // Quick fix for labels/badges in buttons
.btn { .btn {
.label,
.badge { .badge {
position: relative; position: relative;
top: -1px; top: -1px;
} }
} }
.btn-mini { .btn-mini {
.label,
.badge { .badge {
top: 0; top: 0;
} }

2
less/bootstrap.less vendored
View File

@ -52,7 +52,7 @@
// Components: Misc // Components: Misc
@import "thumbnails.less"; @import "thumbnails.less";
@import "media.less"; @import "media.less";
@import "labels-badges.less"; @import "badges.less";
@import "progress-bars.less"; @import "progress-bars.less";
@import "accordion.less"; @import "accordion.less";
@import "carousel.less"; @import "carousel.less";