UNPKG

1.37 kBSCSSView Raw
1// Foundation for Sites by ZURB
2// foundation.zurb.com
3// Licensed under MIT Open Source
4
5////
6/// @group label
7////
8
9/// Default background color for labels.
10/// @type Color
11$label-background: $primary-color !default;
12
13/// Default text color for labels.
14/// @type Color
15$label-color: $white !default;
16
17/// Alternate text color for labels.
18/// @type Color
19$label-color-alt: $black !default;
20
21/// Coloring classes. A map of classes to output in your CSS, like `.secondary`, `.success`, and so on.
22/// @type Map
23$label-palette: $foundation-palette !default;
24
25/// Default font size for labels.
26/// @type Number
27$label-font-size: 0.8rem !default;
28
29/// Default padding inside labels.
30/// @type Number
31$label-padding: 0.33333rem 0.5rem !default;
32
33/// Default radius of labels.
34/// @type Number
35$label-radius: $global-radius !default;
36
37/// Generates base styles for a label.
38@mixin label {
39 display: inline-block;
40 padding: $label-padding;
41
42 border-radius: $label-radius;
43
44 font-size: $label-font-size;
45 line-height: 1;
46 white-space: nowrap;
47 cursor: default;
48}
49
50@mixin foundation-label {
51 .label {
52 @include label;
53
54 background: $label-background;
55 color: $label-color;
56
57 @each $name, $color in $label-palette {
58 &.#{$name} {
59 background: $color;
60 color: color-pick-contrast($color, ($label-color, $label-color-alt));
61 }
62 }
63 }
64}