2013-02-18 07:20:49 +01:00
|
|
|
//
|
|
|
|
// Labels
|
|
|
|
// --------------------------------------------------
|
|
|
|
|
2013-04-19 21:31:55 +02:00
|
|
|
// LESS base
|
2013-02-18 07:20:49 +01:00
|
|
|
|
2013-04-19 21:31:55 +02:00
|
|
|
.label() {
|
|
|
|
display: inline;
|
2013-02-18 07:20:49 +01:00
|
|
|
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;
|
|
|
|
|
2013-04-20 15:54:48 +02:00
|
|
|
// 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)
|
2013-04-20 15:54:48 +02:00
|
|
|
// 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;
|
2013-04-20 15:54:48 +02:00
|
|
|
.a() {
|
2013-04-19 21:31:55 +02:00
|
|
|
&[href] {
|
|
|
|
background-color: darken(@label-danger-bg, 10%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.label-warning() {
|
|
|
|
background-color: @label-warning-bg;
|
2013-04-20 15:54:48 +02:00
|
|
|
.a() {
|
2013-04-19 21:31:55 +02:00
|
|
|
&[href] {
|
|
|
|
background-color: darken(@label-warning-bg, 10%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.label-success() {
|
|
|
|
background-color: @label-success-bg;
|
2013-04-20 15:54:48 +02:00
|
|
|
.a() {
|
2013-04-19 21:31:55 +02:00
|
|
|
&[href] {
|
|
|
|
background-color: darken(@label-success-bg, 10%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.label-info() {
|
|
|
|
background-color: @label-info-bg;
|
2013-04-20 15:54:48 +02:00
|
|
|
.a() {
|
2013-04-19 21:31:55 +02:00
|
|
|
&[href] {
|
|
|
|
background-color: darken(@label-info-bg, 10%);
|
|
|
|
}
|
|
|
|
}
|
2013-02-18 07:20:49 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-19 21:31:55 +02:00
|
|
|
// populate mixins for CSS
|
2013-02-18 07:20:49 +01:00
|
|
|
.label {
|
2013-04-19 21:31:55 +02:00
|
|
|
.label();
|
|
|
|
}
|
|
|
|
|
|
|
|
a.label {
|
|
|
|
.label > .a;
|
|
|
|
}
|
|
|
|
|
|
|
|
.label-danger {
|
|
|
|
.label > .label-danger;
|
2013-04-20 15:54:48 +02:00
|
|
|
.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;
|
2013-04-20 15:54:48 +02:00
|
|
|
.label > .label-warning > .a;
|
2013-04-19 21:31:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.label-success {
|
|
|
|
.label > .label-success;
|
2013-04-20 15:54:48 +02:00
|
|
|
.label > .label-success > .a;
|
2013-02-18 07:20:49 +01:00
|
|
|
}
|
|
|
|
|
2013-04-19 21:31:55 +02:00
|
|
|
.label-info {
|
|
|
|
.label > .label-info;
|
2013-04-20 15:54:48 +02:00
|
|
|
.label > .label-info > .a;
|
2013-04-19 21:31:55 +02:00
|
|
|
}
|