UNPKG

9.78 kBSCSSView Raw
1/* -------------------------------------------------------------------
2 Microtip
3
4 Modern, lightweight css-only tooltips
5 Just 1kb minified and gzipped
6
7 @author Ghosh
8 @package Microtip
9
10----------------------------------------------------------------------
11 1. Base Styles
12 2. Direction Modifiers
13 3. Position Modifiers
14--------------------------------------------------------------------*/
15
16
17/* ------------------------------------------------
18 [1] Base Styles
19-------------------------------------------------*/
20
21.uppy-Root [aria-label][role~="tooltip"] {
22 /* no important */
23 position: relative;
24}
25
26.uppy-Root [aria-label][role~="tooltip"]::before,
27.uppy-Root [aria-label][role~="tooltip"]::after {
28 /* no important */
29 transform: translate3d(0, 0, 0);
30 -webkit-backface-visibility: hidden;
31 backface-visibility: hidden;
32 will-change: transform;
33 opacity: 0;
34 pointer-events: none;
35 transition: all var(--microtip-transition-duration, .18s) var(--microtip-transition-easing, ease-in-out) var(--microtip-transition-delay, 0s);
36 position: absolute;
37 box-sizing: border-box;
38 z-index: 10;
39 transform-origin: top;
40}
41
42.uppy-Root [aria-label][role~="tooltip"]::before {
43 /* no important */
44 background-size: 100% auto !important;
45 content: "";
46}
47
48.uppy-Root [aria-label][role~="tooltip"]::after {
49 /* no important */
50 background: rgba(17, 17, 17, .9);
51 border-radius: 4px;
52 color: #ffffff;
53 content: attr(aria-label);
54 font-size: var(--microtip-font-size, 13px);
55 font-weight: var(--microtip-font-weight, normal);
56 text-transform: var(--microtip-text-transform, none);
57 padding: .5em 1em;
58 white-space: nowrap;
59 box-sizing: content-box;
60}
61
62.uppy-Root [aria-label][role~="tooltip"]:hover::before,
63.uppy-Root [aria-label][role~="tooltip"]:hover::after,
64.uppy-Root [aria-label][role~="tooltip"]:focus::before,
65.uppy-Root [aria-label][role~="tooltip"]:focus::after {
66 /* no important */
67 opacity: 1;
68 pointer-events: auto;
69}
70
71
72
73/* ------------------------------------------------
74 [2] Position Modifiers
75-------------------------------------------------*/
76
77.uppy-Root [role~="tooltip"][data-microtip-position|="top"]::before {
78 /* no important */
79 background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%280%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
80 height: 6px;
81 width: 18px;
82 margin-bottom: 5px;
83}
84
85.uppy-Root [role~="tooltip"][data-microtip-position|="top"]::after {
86 /* no important */
87 margin-bottom: 11px;
88}
89
90.uppy-Root [role~="tooltip"][data-microtip-position|="top"]::before {
91 /* no important */
92 transform: translate3d(-50%, 0, 0);
93 bottom: 100%;
94 left: 50%;
95}
96
97.uppy-Root [role~="tooltip"][data-microtip-position|="top"]:hover::before {
98 /* no important */
99 transform: translate3d(-50%, -5px, 0);
100}
101
102.uppy-Root [role~="tooltip"][data-microtip-position|="top"]::after {
103 /* no important */
104 transform: translate3d(-50%, 0, 0);
105 bottom: 100%;
106 left: 50%;
107}
108
109.uppy-Root [role~="tooltip"][data-microtip-position="top"]:hover::after {
110 /* no important */
111 transform: translate3d(-50%, -5px, 0);
112}
113
114/* ------------------------------------------------
115 [2.1] Top Left
116-------------------------------------------------*/
117.uppy-Root [role~="tooltip"][data-microtip-position="top-left"]::after {
118 /* no important */
119 transform: translate3d(calc(-100% + 16px), 0, 0);
120 bottom: 100%;
121}
122
123.uppy-Root [role~="tooltip"][data-microtip-position="top-left"]:hover::after {
124 /* no important */
125 transform: translate3d(calc(-100% + 16px), -5px, 0);
126}
127
128
129/* ------------------------------------------------
130 [2.2] Top Right
131-------------------------------------------------*/
132.uppy-Root [role~="tooltip"][data-microtip-position="top-right"]::after {
133 /* no important */
134 transform: translate3d(calc(0% + -16px), 0, 0);
135 bottom: 100%;
136}
137
138.uppy-Root [role~="tooltip"][data-microtip-position="top-right"]:hover::after {
139 /* no important */
140 transform: translate3d(calc(0% + -16px), -5px, 0);
141}
142
143
144/* ------------------------------------------------
145 [2.3] Bottom
146-------------------------------------------------*/
147.uppy-Root [role~="tooltip"][data-microtip-position|="bottom"]::before {
148 /* no important */
149 background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28180%2018%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
150 height: 6px;
151 width: 18px;
152 margin-top: 5px;
153 margin-bottom: 0;
154}
155
156.uppy-Root [role~="tooltip"][data-microtip-position|="bottom"]::after {
157 /* no important */
158 margin-top: 11px;
159}
160
161.uppy-Root [role~="tooltip"][data-microtip-position|="bottom"]::before {
162 /* no important */
163 transform: translate3d(-50%, -10px, 0);
164 bottom: auto;
165 left: 50%;
166 top: 100%;
167}
168
169.uppy-Root [role~="tooltip"][data-microtip-position|="bottom"]:hover::before {
170 /* no important */
171 transform: translate3d(-50%, 0, 0);
172}
173
174.uppy-Root [role~="tooltip"][data-microtip-position|="bottom"]::after {
175 /* no important */
176 transform: translate3d(-50%, -10px, 0);
177 top: 100%;
178 left: 50%;
179}
180
181.uppy-Root [role~="tooltip"][data-microtip-position="bottom"]:hover::after {
182 /* no important */
183 transform: translate3d(-50%, 0, 0);
184}
185
186
187/* ------------------------------------------------
188 [2.4] Bottom Left
189-------------------------------------------------*/
190.uppy-Root [role~="tooltip"][data-microtip-position="bottom-left"]::after {
191 /* no important */
192 transform: translate3d(calc(-100% + 16px), -10px, 0);
193 top: 100%;
194}
195
196.uppy-Root [role~="tooltip"][data-microtip-position="bottom-left"]:hover::after {
197 /* no important */
198 transform: translate3d(calc(-100% + 16px), 0, 0);
199}
200
201
202/* ------------------------------------------------
203 [2.5] Bottom Right
204-------------------------------------------------*/
205.uppy-Root [role~="tooltip"][data-microtip-position="bottom-right"]::after {
206 /* no important */
207 transform: translate3d(calc(0% + -16px), -10px, 0);
208 top: 100%;
209}
210
211.uppy-Root [role~="tooltip"][data-microtip-position="bottom-right"]:hover::after {
212 /* no important */
213 transform: translate3d(calc(0% + -16px), 0, 0);
214}
215
216
217/* ------------------------------------------------
218 [2.6] Left
219-------------------------------------------------*/
220.uppy-Root [role~="tooltip"][data-microtip-position="left"]::before,
221.uppy-Root [role~="tooltip"][data-microtip-position="left"]::after {
222 /* no important */
223 bottom: auto;
224 left: auto;
225 right: 100%;
226 top: 50%;
227 transform: translate3d(10px, -50%, 0);
228}
229
230.uppy-Root [role~="tooltip"][data-microtip-position="left"]::before {
231 /* no important */
232 background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%28-90%2018%2018%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
233 height: 18px;
234 width: 6px;
235 margin-right: 5px;
236 margin-bottom: 0;
237}
238
239.uppy-Root [role~="tooltip"][data-microtip-position="left"]::after {
240 /* no important */
241 margin-right: 11px;
242}
243
244.uppy-Root [role~="tooltip"][data-microtip-position="left"]:hover::before,
245.uppy-Root [role~="tooltip"][data-microtip-position="left"]:hover::after {
246 /* no important */
247 transform: translate3d(0, -50%, 0);
248}
249
250
251/* ------------------------------------------------
252 [2.7] Right
253-------------------------------------------------*/
254.uppy-Root [role~="tooltip"][data-microtip-position="right"]::before,
255.uppy-Root [role~="tooltip"][data-microtip-position="right"]::after {
256 /* no important */
257 bottom: auto;
258 left: 100%;
259 top: 50%;
260 transform: translate3d(-10px, -50%, 0);
261}
262
263.uppy-Root [role~="tooltip"][data-microtip-position="right"]::before {
264 /* no important */
265 background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817,%2017,%2017,%200.9%29%22%20transform%3D%22rotate%2890%206%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E") no-repeat;
266 height: 18px;
267 width: 6px;
268 margin-bottom: 0;
269 margin-left: 5px;
270}
271
272.uppy-Root [role~="tooltip"][data-microtip-position="right"]::after {
273 /* no important */
274 margin-left: 11px;
275}
276
277.uppy-Root [role~="tooltip"][data-microtip-position="right"]:hover::before,
278.uppy-Root [role~="tooltip"][data-microtip-position="right"]:hover::after {
279 /* no important */
280 transform: translate3d(0, -50%, 0);
281}
282
283/* ------------------------------------------------
284 [3] Size
285-------------------------------------------------*/
286.uppy-Root [role~="tooltip"][data-microtip-size="small"]::after {
287 /* no important */
288 white-space: initial;
289 width: 80px;
290}
291
292.uppy-Root [role~="tooltip"][data-microtip-size="medium"]::after {
293 /* no important */
294 white-space: initial;
295 width: 150px;
296}
297
298.uppy-Root [role~="tooltip"][data-microtip-size="large"]::after {
299 /* no important */
300 white-space: initial;
301 width: 260px;
302}