-
Notifications
You must be signed in to change notification settings - Fork 841
/
_icon.scss
77 lines (64 loc) · 1.61 KB
/
_icon.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
.euiIcon {
flex-shrink: 0; // Ensures it never scales down below its intended size
display: inline-block;
vertical-align: middle;
fill: currentColor;
transform: translate(0, 0); // Hack to fix Firefox "softness"
&:focus {
opacity: 1; // We often hide icons on hover. Make sure they appear on focus.
background: $euiFocusBackgroundColor;
}
}
// App icons are two-toned so get an extra class. This provides the base color.
.euiIcon--app {
fill: $euiTextColor;
// This provides the default secondary color
.euiIcon__fillSecondary {
fill: makeGraphicContrastColor($euiColorSecondary);
}
}
.euiIcon-isLoading {
opacity: $euiIconLoadingOpacity;
background-color: currentColor;
border-radius: $euiBorderRadius;
}
.euiIcon-isLoaded {
animation: euiIconLoading $euiAnimSpeedNormal ease-in 0s 1 forwards;
}
// COLORS
@each $name, $color in $euiIconColors {
.euiIcon--#{$name} {
// Use color attribute so currentColor can be used in more properties
color: $color;
}
}
// App icon special cases for fully mono
.euiIcon--text,
.euiIcon--subdued,
.euiIcon--primary,
.euiIcon--customColor {
&,
.euiIcon__fillSecondary {
fill: currentColor;
}
}
// Use the negative fill on SVG elements that need to flip portions
// of the icon to light and dark compatible modes. You can see this
// in use on the Elastic logo icons.
.euiIcon__fillNegative {
fill: $euiColorDarkestShade;
}
// SIZES
@each $name, $size in $euiIconSizes {
.euiIcon--#{$name} {
@include size($size);
}
}
@keyframes euiIconLoading {
0% {
opacity: $euiIconLoadingOpacity;
}
100% {
opacity: 1;
}
}