-
Notifications
You must be signed in to change notification settings - Fork 72
/
_beta_badge.scss
98 lines (83 loc) · 2.4 KB
/
_beta_badge.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*!
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
.ouiBetaBadge {
display: inline-block;
padding: 0 $ouiSize;
border-radius: $ouiSizeL;
box-shadow: inset 0 0 0 1px $ouiBorderColor;
vertical-align: super; // if displayed inline with text
font-size: $ouiFontSizeXS;
font-weight: $ouiFontWeightBold;
text-transform: uppercase;
letter-spacing: .05em;
line-height: $ouiSizeL;
text-align: center;
white-space: nowrap;
cursor: default;
&:focus {
@include ouiFocusRing;
// Can't use `currentColor` because of possible white text, so always keep it black
outline-color: lightOrDarkTheme($ouiColorInk, $ouiColorGhost);
// The rounded corners of the badge doesn't match well with the outline, so push it outward
outline-offset: 2px;
}
&:not(.ouiBetaBadge--hollow) {
box-shadow: none;
}
&.ouiBetaBadge--small {
@include fontSize($ouiFontSize * .625);
line-height: $ouiSize + $ouiSizeXS;
padding: 0 $ouiSizeM;
}
}
// When it's just an icon, make it a circle
.ouiBetaBadge--iconOnly {
padding: 0;
width: $ouiSizeL;
.ouiBetaBadge__icon {
position: relative;
margin-top: -1px;
}
&.ouiBetaBadge--small {
width: $ouiSize + $ouiSizeXS;
padding: 0;
}
}
.ouiBetaBadge--singleLetter {
padding: 0 0 0 1px;
width: $ouiSizeL;
&.ouiBetaBadge--small {
width: $ouiSize + $ouiSizeXS;
padding: 0 0 0 1px;
}
}
.ouiBetaBadge--subdued {
$backgroundColor: tint($ouiColorLightShade, 30%);
background: $backgroundColor;
color: chooseLightOrDarkText($backgroundColor, $ouiColorGhost, $ouiColorInk);
&.ouiBetaBadge-isClickable {
color: chooseLightOrDarkText($backgroundColor, $ouiColorGhost, $ouiColorInk);
}
}
.ouiBetaBadge--hollow {
&.ouiBetaBadge-isClickable {
$backgroundColor: tint($ouiColorLightShade, 30%);
color: chooseLightOrDarkText($backgroundColor, $ouiColorGhost, $ouiColorInk);
}
}
.ouiBetaBadge--accent {
$backgroundColor: $ouiColorAccentText;
background: $backgroundColor;
color: chooseLightOrDarkText($backgroundColor, $ouiColorGhost, $ouiColorInk);
&.ouiBetaBadge-isClickable {
color: chooseLightOrDarkText($backgroundColor, $ouiColorGhost, $ouiColorInk);
}
}