source: pro-violet-viettel/docs/Space/assets/css/less/label-badge.less @ 290

Last change on this file since 290 was 290, checked in by lamdt, 11 years ago
File size: 4.0 KB
RevLine 
[290]1/* labels & badges */
2.label {
3 border-radius:0;
4 text-shadow:none;
5 font-weight:normal;
6
7 display:inline-block;
8
9 background-color:@label-default !important;
10
11 &[class*="col-"][class*="arrow"] {
12        min-height:0;
13 }
14}
15
16
17@media screen and (-webkit-min-device-pixel-ratio:0) {
18        //default display:none causes problems with Android Webview
19        ::safari-only,.label:empty {
20                display: inline-block;
21        }
22        ::safari-only,.badge:empty {
23                display: inline-block;
24        }
25}
26
27
28
29
30.badge {
31 text-shadow:none;
32 font-size:12px;
33 padding-top:1px;
34 padding-bottom:3px;
35 font-weight:normal;
36 line-height:15px;
37 background-color:@label-default !important;
38 
39 &.no-radius { border-radius:0; }
40 &.radius-1 { border-radius:1px; }
41 &.radius-2 { border-radius:2px; }
42 &.radius-3 { border-radius:3px; }
43 &.radius-4 { border-radius:4px; }
44 &.radius-5 { border-radius:5px; }
45 &.radius-6 { border-radius:6px; }
46}
47.label-transparent, .badge-transparent {
48        background-color:transparent !important;
49}
50
51
52
53//labels
54.label-color(@color) {
55  @label-class:~`"label-@{color}"`;
56  @badge-class:~`"badge-@{color}"`;
57  @label-color:@@label-class;
58
59 .@{label-class}, .@{badge-class} {
60        background-color:@label-color !important;
61 } 
62}
63
64.label-arrow(@color) {
65   @label-class:~`"label-@{color}"`;
66   @label-color:@@label-class;
67
68  .@{label-class}{
69        &.arrowed:before {
70                border-right-color:@label-color;
71        }
72        &.arrowed-in:before {
73                border-color:@label-color;
74        }
75        &.arrowed-right:after {
76                border-left-color:@label-color;
77        }
78        &.arrowed-in-right:after {
79                border-color:@label-color;
80        }
81  }
82}
83.label-color(~"grey");
84.label-color(~"info");
85.label-color(~"primary");
86.label-color(~"success");
87.label-color(~"danger");
88.label-color(~"important");
89.label-color(~"inverse");
90.label-color(~"warning");
91.label-color(~"pink");
92.label-color(~"purple");
93.label-color(~"yellow");
94.label-color(~"light");
95
96
97.badge-yellow, .label-yellow {
98        color:#996633 !important;
99        border-color:@label-yellow;
100}
101.badge-light, .label-light {
102        color:#888 !important;
103}
104
105
106
107
108.label.arrowed , .label.arrowed-in {
109 position:relative;
110 z-index: 1;
111 &:before {
112        display:inline-block;
113        content:"";
114        position:absolute;
115        top:0;
116        z-index: -1;
117       
118        border:1px solid transparent;
119
120        border-right-color:@label-default;
121 }
122}
123.label.arrowed-in:before {
124        border-color:@label-default;
125        border-left-color:transparent !important;
126}
127
128
129.label.arrowed-right , .label.arrowed-in-right {
130 position:relative;
131 z-index: 1;
132 &:after {
133        display:inline-block;
134        content:"";
135        position:absolute;
136        top:0;
137        z-index: -1;
138       
139        border:1px solid transparent;
140
141        border-left-color:@label-default;
142 }
143}
144.label.arrowed-in-right:after {
145        border-color:@label-default;
146        border-right-color:transparent !important;
147}
148
149
150
151.label-arrow(~"info");
152.label-arrow(~"primary");
153.label-arrow(~"success");
154.label-arrow(~"warning");
155.label-arrow(~"important");
156.label-arrow(~"danger");
157.label-arrow(~"inverse");
158.label-arrow(~"pink");
159.label-arrow(~"purple");
160.label-arrow(~"yellow");
161.label-arrow(~"light");
162.label-arrow(~"grey");
163
164
165.label {
166 .label-size(12px, 1.15, 20px, 10px, 5px);
167}
168.label-lg {
169  padding:0.3em 0.6em 0.4em;
170 .label-size(13px, 1.1, 24px, 12px, 6px);
171}
172.label-xlg {
173  padding:0.3em 0.7em 0.4em;
174 .label-size(14px, 1.3, 28px, 14px, 7px);
175}
176.label-sm {
177  padding:0.2em 0.4em 0.3em;
178 .label-size(11px, 1, 18px, 9px, 4px);
179}
180.label > span , .label > [class*="icon-"] {
181 line-height: 1;
182 vertical-align: bottom;
183}
184
185
186.label-size(@font-size, @line-height, @height, @border-height, @border-width) {
187  font-size: @font-size;
188  line-height: @line-height;
189  height: @height;
190 
191  &.arrowed {
192        margin-left: @border-width;
193        &:before {
194                left: -(@border-width * 2);
195                border-width: @border-height @border-width;
196        }
197  }
198  &.arrowed-in {
199        margin-left: (@border-width);
200        &:before {
201                left: -@border-width;
202                border-width: @border-height @border-width;
203        }
204  }
205
206  &.arrowed-right {
207        margin-right: @border-width;
208        &:after {
209                right: -(@border-width * 2);
210                border-width: @border-height @border-width;
211        }
212  }
213  &.arrowed-in-right {
214        margin-right: (@border-width);
215        &:after {
216                right: -@border-width;
217                border-width: @border-height @border-width;
218        }
219  }
220}
221
222
223
Note: See TracBrowser for help on using the repository browser.