-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
icon.css
144 lines (115 loc) 路 2.88 KB
/
icon.css
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
:host {
display: inline-block;
width: 1em;
height: 1em;
contain: strict;
fill: currentColor;
box-sizing: content-box !important;
}
:host .ionicon {
stroke: currentColor;
}
.ionicon-fill-none {
fill: none;
}
.ionicon-stroke-width {
stroke-width: 32px;
stroke-width: var(--ionicon-stroke-width, 32px);
}
.icon-inner,
.ionicon,
svg {
display: block;
height: 100%;
width: 100%;
}
/* Icon RTL
* -----------------------------------------------------------
*/
/**
* Safari <16.4 incorrectly reports
* that it supports :dir(rtl) when it does not.
* This @supports statement lets us target
* WebKit browsers to apply the RTL fallback.
* -webkit-named-image only exists on WebKit.
* For WebKit browsers that do support :dir(rtl)
* (i.e. Safari >= 16.4) then the :dir(rtl)
* code farther down on the page will take
* effect and override this fallback.
*/
@supports (background: -webkit-named-image(i)) {
:host(.icon-rtl) .icon-inner {
transform: scaleX(-1);
}
}
/**
* Fallback for browsers that support
* neither :host-context nor :dir.
* The icon will not react to dir
* changes, but it will at least
* respect the dir on component load.
*/
@supports not selector(:dir(rtl)) and selector(:host-context([dir='rtl'])) {
:host(.icon-rtl) .icon-inner {
transform: scaleX(-1);
}
}
/* :host-context is supported in chromium; :dir is supported in safari & firefox */
:host(.flip-rtl):host-context([dir='rtl']) .icon-inner {
transform: scaleX(-1);
}
@supports selector(:dir(rtl)) {
:host(.flip-rtl:dir(rtl)) .icon-inner {
transform: scaleX(-1);
}
/**
* This is needed for WebKit otherwise the fallback
* will always cause the icon to be flipped if the document
* loads in RTL.
*/
:host(.flip-rtl:dir(ltr)) .icon-inner {
transform: scaleX(1);
}
}
/* Icon Sizes
* -----------------------------------------------------------
*/
:host(.icon-small) {
font-size: 1.125rem !important;
}
:host(.icon-large) {
font-size: 2rem !important;
}
/* Icon Colors
* -----------------------------------------------------------
*/
:host(.ion-color) {
color: var(--ion-color-base) !important;
}
:host(.ion-color-primary) {
--ion-color-base: var(--ion-color-primary, #3880ff);
}
:host(.ion-color-secondary) {
--ion-color-base: var(--ion-color-secondary, #0cd1e8);
}
:host(.ion-color-tertiary) {
--ion-color-base: var(--ion-color-tertiary, #f4a942);
}
:host(.ion-color-success) {
--ion-color-base: var(--ion-color-success, #10dc60);
}
:host(.ion-color-warning) {
--ion-color-base: var(--ion-color-warning, #ffce00);
}
:host(.ion-color-danger) {
--ion-color-base: var(--ion-color-danger, #f14141);
}
:host(.ion-color-light) {
--ion-color-base: var(--ion-color-light, #f4f5f8);
}
:host(.ion-color-medium) {
--ion-color-base: var(--ion-color-medium, #989aa2);
}
:host(.ion-color-dark) {
--ion-color-base: var(--ion-color-dark, #222428);
}