0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00
Bootstrap/less/labels.less

98 lines
1.9 KiB
Plaintext
Raw Normal View History

//
// Labels
// --------------------------------------------------
2013-04-19 21:31:55 +02:00
// LESS base
2013-04-19 21:31:55 +02:00
.label() {
display: inline;
padding: .25em .6em;
font-size: 75%;
font-weight: 500;
color: #fff;
line-height: 1;
vertical-align: middle;
white-space: nowrap;
text-align: center;
background-color: @grayLight;
border-radius: .25em;
// Hover state, but only for links - as a mixin which will be accessible as LESS shorthand: .label > .a;
2013-04-19 21:31:55 +02:00
.a() {
&:hover,
&:focus {
color: #fff;
text-decoration: none;
cursor: pointer;
}
}
// Colors
// Only give background-color difference to links (and to simplify, we don't qualifty with `a` but [href] attribute)
// If there is a need for [href] then use local mixin a() via ex: .label-danger > .a; to attach additional CSS for [href] attr
2013-04-19 21:31:55 +02:00
.label-danger() {
background-color: @label-danger-bg;
.a() {
2013-04-19 21:31:55 +02:00
&[href] {
background-color: darken(@label-danger-bg, 10%);
}
}
}
.label-warning() {
background-color: @label-warning-bg;
.a() {
2013-04-19 21:31:55 +02:00
&[href] {
background-color: darken(@label-warning-bg, 10%);
}
}
}
.label-success() {
background-color: @label-success-bg;
.a() {
2013-04-19 21:31:55 +02:00
&[href] {
background-color: darken(@label-success-bg, 10%);
}
}
}
.label-info() {
background-color: @label-info-bg;
.a() {
2013-04-19 21:31:55 +02:00
&[href] {
background-color: darken(@label-info-bg, 10%);
}
}
}
}
2013-04-19 21:31:55 +02:00
// populate mixins for CSS
.label {
2013-04-19 21:31:55 +02:00
.label();
}
a.label {
.label > .a;
}
.label-danger {
.label > .label-danger;
.label > .label-danger > .a; // will produce .label-danger[href] class for folks who like to use class in HTML
2013-04-19 21:31:55 +02:00
}
.label-warning {
.label > .label-warning;
.label > .label-warning > .a;
2013-04-19 21:31:55 +02:00
}
.label-success {
.label > .label-success;
.label > .label-success > .a;
}
2013-04-19 21:31:55 +02:00
.label-info {
.label > .label-info;
.label > .label-info > .a;
2013-04-19 21:31:55 +02:00
}