forked from elastic/eui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_icon.scss
87 lines (72 loc) · 2.01 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
78
79
80
81
82
83
84
85
86
87
.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($euiColorSuccess);
}
}
.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;
}
}
// Really force all paths to inherit when the color is ghost/text (specifically for logos)
.euiIcon--ghost:not([data-type='logoElastic']),
.euiIcon--text:not([data-type='logoElastic']) {
*[fill],
.euiIcon__fillNegative {
fill: currentColor !important; // sass-lint:disable-line no-important
}
}
// Elastic logo specific colors
.euiIcon--ghost[data-type='logoElastic'],
.euiIcon--text[data-type='logoElastic'] {
*[fill] {
fill: none !important; // sass-lint:disable-line no-important
}
.outline {
fill: currentColor !important; // sass-lint:disable-line no-important
}
}
// 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;
}
}