Skip to content
Permalink
Newer
Older
100644 466 lines (385 sloc) 10.8 KB
Oct 1, 2021
1
/*! Hint.css (base version) - v2.7.0 - 2021-10-01
2
* https://kushagra.dev/lab/hint/
3
* Copyright (c) 2021 Kushagra Gour */
Jan 25, 2016
4
Nov 16, 2018
5
/*-------------------------------------*\
6
HINT.css - A CSS tooltip library
7
\*-------------------------------------*/
8
/**
9
* HINT.css is a tooltip library made in pure CSS.
10
*
11
* Source: https://github.com/chinchang/hint.css
12
* Demo: http://kushagragour.in/lab/hint/
13
*
14
*/
15
/**
16
* source: hint-core.scss
17
*
18
* Defines the basic styling for the tooltip.
19
* Each tooltip is made of 2 parts:
20
* 1) body (:after)
21
* 2) arrow (:before)
22
*
23
* Classes added:
24
* 1) hint
25
*/
May 21, 2016
26
[class*="hint--"] {
27
position: relative;
28
display: inline-block;
29
/**
Nov 22, 2015
30
* tooltip arrow
31
*/
Nov 22, 2015
33
* tooltip body
34
*/ }
May 21, 2016
35
[class*="hint--"]:before, [class*="hint--"]:after {
36
position: absolute;
37
-webkit-transform: translate3d(0, 0, 0);
38
-moz-transform: translate3d(0, 0, 0);
39
transform: translate3d(0, 0, 0);
40
visibility: hidden;
41
opacity: 0;
42
z-index: 1000000;
43
pointer-events: none;
44
-webkit-transition: 0.3s ease;
45
-moz-transition: 0.3s ease;
46
transition: 0.3s ease;
47
-webkit-transition-delay: 0ms;
48
-moz-transition-delay: 0ms;
49
transition-delay: 0ms; }
May 21, 2016
50
[class*="hint--"]:hover:before, [class*="hint--"]:hover:after {
51
visibility: visible;
52
opacity: 1; }
May 21, 2016
53
[class*="hint--"]:hover:before, [class*="hint--"]:hover:after {
54
-webkit-transition-delay: 100ms;
55
-moz-transition-delay: 100ms;
56
transition-delay: 100ms; }
May 21, 2016
57
[class*="hint--"]:before {
58
content: '';
59
position: absolute;
60
background: transparent;
61
border: 6px solid transparent;
62
z-index: 1000001; }
May 21, 2016
63
[class*="hint--"]:after {
64
background: #383838;
65
color: white;
66
padding: 8px 10px;
67
font-size: 12px;
Feb 14, 2016
68
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
69
line-height: 12px;
70
white-space: nowrap; }
May 21, 2016
71
[class*="hint--"][aria-label]:after {
72
content: attr(aria-label); }
73
[class*="hint--"][data-hint]:after {
74
content: attr(data-hint); }
May 21, 2016
76
[aria-label='']:before, [aria-label='']:after,
77
[data-hint='']:before,
78
[data-hint='']:after {
79
display: none !important; }
80
81
/**
82
* source: hint-position.scss
83
*
84
* Defines the positoning logic for the tooltips.
85
*
86
* Classes added:
87
* 1) hint--top
88
* 2) hint--bottom
89
* 3) hint--left
90
* 4) hint--right
91
*/
92
/**
93
* set default color for tooltip arrows
94
*/
Nov 22, 2015
95
.hint--top-left:before {
96
border-top-color: #383838; }
97
98
.hint--top-right:before {
99
border-top-color: #383838; }
100
101
.hint--top:before {
102
border-top-color: #383838; }
103
Nov 22, 2015
104
.hint--bottom-left:before {
105
border-bottom-color: #383838; }
106
107
.hint--bottom-right:before {
108
border-bottom-color: #383838; }
109
110
.hint--bottom:before {
111
border-bottom-color: #383838; }
112
113
.hint--left:before {
114
border-left-color: #383838; }
115
116
.hint--right:before {
117
border-right-color: #383838; }
118
119
/**
120
* top tooltip
121
*/
122
.hint--top:before {
Mar 26, 2016
123
margin-bottom: -11px; }
Nov 22, 2015
124
125
.hint--top:before, .hint--top:after {
126
bottom: 100%;
127
left: 50%; }
Nov 22, 2015
128
Mar 26, 2016
129
.hint--top:before {
130
left: calc(50% - 6px); }
131
132
.hint--top:after {
Jan 25, 2016
133
-webkit-transform: translateX(-50%);
134
-moz-transform: translateX(-50%);
Nov 22, 2015
135
transform: translateX(-50%); }
136
Jun 5, 2016
137
.hint--top:hover:before {
Mar 26, 2016
138
-webkit-transform: translateY(-8px);
139
-moz-transform: translateY(-8px);
140
transform: translateY(-8px); }
141
Jun 5, 2016
142
.hint--top:hover:after {
Nov 22, 2015
143
-webkit-transform: translateX(-50%) translateY(-8px);
144
-moz-transform: translateX(-50%) translateY(-8px);
145
transform: translateX(-50%) translateY(-8px); }
146
147
/**
148
* bottom tooltip
149
*/
150
.hint--bottom:before {
Mar 26, 2016
151
margin-top: -11px; }
Nov 22, 2015
152
153
.hint--bottom:before, .hint--bottom:after {
154
top: 100%;
155
left: 50%; }
Nov 22, 2015
156
Mar 26, 2016
157
.hint--bottom:before {
158
left: calc(50% - 6px); }
159
160
.hint--bottom:after {
Jan 25, 2016
161
-webkit-transform: translateX(-50%);
162
-moz-transform: translateX(-50%);
Nov 22, 2015
163
transform: translateX(-50%); }
164
Jun 5, 2016
165
.hint--bottom:hover:before {
Mar 26, 2016
166
-webkit-transform: translateY(8px);
167
-moz-transform: translateY(8px);
168
transform: translateY(8px); }
169
Jun 5, 2016
170
.hint--bottom:hover:after {
Nov 22, 2015
171
-webkit-transform: translateX(-50%) translateY(8px);
172
-moz-transform: translateX(-50%) translateY(8px);
173
transform: translateX(-50%) translateY(8px); }
174
175
/**
176
* right tooltip
177
*/
178
.hint--right:before {
Mar 26, 2016
179
margin-left: -11px;
180
margin-bottom: -6px; }
Nov 22, 2015
181
182
.hint--right:after {
183
margin-bottom: -14px; }
Nov 22, 2015
184
185
.hint--right:before, .hint--right:after {
186
left: 100%;
187
bottom: 50%; }
Nov 22, 2015
188
Jun 5, 2016
189
.hint--right:hover:before {
Mar 26, 2016
190
-webkit-transform: translateX(8px);
191
-moz-transform: translateX(8px);
192
transform: translateX(8px); }
193
Jun 5, 2016
194
.hint--right:hover:after {
195
-webkit-transform: translateX(8px);
196
-moz-transform: translateX(8px);
197
transform: translateX(8px); }
198
199
/**
200
* left tooltip
201
*/
202
.hint--left:before {
Mar 26, 2016
203
margin-right: -11px;
204
margin-bottom: -6px; }
Nov 22, 2015
205
206
.hint--left:after {
207
margin-bottom: -14px; }
Nov 22, 2015
208
209
.hint--left:before, .hint--left:after {
210
right: 100%;
211
bottom: 50%; }
Nov 22, 2015
212
Jun 5, 2016
213
.hint--left:hover:before {
Mar 26, 2016
214
-webkit-transform: translateX(-8px);
215
-moz-transform: translateX(-8px);
216
transform: translateX(-8px); }
217
Jun 5, 2016
218
.hint--left:hover:after {
219
-webkit-transform: translateX(-8px);
220
-moz-transform: translateX(-8px);
221
transform: translateX(-8px); }
222
Nov 22, 2015
223
/**
224
* top-left tooltip
225
*/
226
.hint--top-left:before {
Mar 26, 2016
227
margin-bottom: -11px; }
Nov 22, 2015
228
229
.hint--top-left:before, .hint--top-left:after {
230
bottom: 100%;
231
left: 50%; }
232
Mar 26, 2016
233
.hint--top-left:before {
234
left: calc(50% - 6px); }
235
236
.hint--top-left:after {
Jan 25, 2016
237
-webkit-transform: translateX(-100%);
238
-moz-transform: translateX(-100%);
Nov 22, 2015
239
transform: translateX(-100%); }
240
241
.hint--top-left:after {
Mar 26, 2016
242
margin-left: 12px; }
243
Jun 5, 2016
244
.hint--top-left:hover:before {
Mar 26, 2016
245
-webkit-transform: translateY(-8px);
246
-moz-transform: translateY(-8px);
247
transform: translateY(-8px); }
Nov 22, 2015
248
Jun 5, 2016
249
.hint--top-left:hover:after {
Nov 22, 2015
250
-webkit-transform: translateX(-100%) translateY(-8px);
251
-moz-transform: translateX(-100%) translateY(-8px);
252
transform: translateX(-100%) translateY(-8px); }
253
254
/**
255
* top-right tooltip
256
*/
257
.hint--top-right:before {
Mar 26, 2016
258
margin-bottom: -11px; }
Nov 22, 2015
259
260
.hint--top-right:before, .hint--top-right:after {
261
bottom: 100%;
262
left: 50%; }
263
Mar 26, 2016
264
.hint--top-right:before {
265
left: calc(50% - 6px); }
266
267
.hint--top-right:after {
Jan 25, 2016
268
-webkit-transform: translateX(0);
269
-moz-transform: translateX(0);
Nov 22, 2015
270
transform: translateX(0); }
271
272
.hint--top-right:after {
Mar 26, 2016
273
margin-left: -12px; }
Nov 22, 2015
274
Jun 5, 2016
275
.hint--top-right:hover:before {
Mar 26, 2016
276
-webkit-transform: translateY(-8px);
277
-moz-transform: translateY(-8px);
278
transform: translateY(-8px); }
279
Jun 5, 2016
280
.hint--top-right:hover:after {
Nov 22, 2015
281
-webkit-transform: translateY(-8px);
282
-moz-transform: translateY(-8px);
283
transform: translateY(-8px); }
284
285
/**
286
* bottom-left tooltip
287
*/
288
.hint--bottom-left:before {
Mar 26, 2016
289
margin-top: -11px; }
Nov 22, 2015
290
291
.hint--bottom-left:before, .hint--bottom-left:after {
292
top: 100%;
293
left: 50%; }
294
Mar 26, 2016
295
.hint--bottom-left:before {
296
left: calc(50% - 6px); }
297
298
.hint--bottom-left:after {
Jan 25, 2016
299
-webkit-transform: translateX(-100%);
300
-moz-transform: translateX(-100%);
Nov 22, 2015
301
transform: translateX(-100%); }
302
303
.hint--bottom-left:after {
Mar 26, 2016
304
margin-left: 12px; }
305
Jun 5, 2016
306
.hint--bottom-left:hover:before {
Mar 26, 2016
307
-webkit-transform: translateY(8px);
308
-moz-transform: translateY(8px);
309
transform: translateY(8px); }
Nov 22, 2015
310
Jun 5, 2016
311
.hint--bottom-left:hover:after {
Nov 22, 2015
312
-webkit-transform: translateX(-100%) translateY(8px);
313
-moz-transform: translateX(-100%) translateY(8px);
314
transform: translateX(-100%) translateY(8px); }
315
316
/**
317
* bottom-right tooltip
318
*/
319
.hint--bottom-right:before {
Mar 26, 2016
320
margin-top: -11px; }
Nov 22, 2015
321
322
.hint--bottom-right:before, .hint--bottom-right:after {
323
top: 100%;
324
left: 50%; }
325
Mar 26, 2016
326
.hint--bottom-right:before {
327
left: calc(50% - 6px); }
328
329
.hint--bottom-right:after {
Jan 25, 2016
330
-webkit-transform: translateX(0);
331
-moz-transform: translateX(0);
Nov 22, 2015
332
transform: translateX(0); }
333
334
.hint--bottom-right:after {
Mar 26, 2016
335
margin-left: -12px; }
336
Jun 5, 2016
337
.hint--bottom-right:hover:before {
Mar 26, 2016
338
-webkit-transform: translateY(8px);
339
-moz-transform: translateY(8px);
340
transform: translateY(8px); }
Nov 22, 2015
341
Jun 5, 2016
342
.hint--bottom-right:hover:after {
Nov 22, 2015
343
-webkit-transform: translateY(8px);
344
-moz-transform: translateY(8px);
345
transform: translateY(8px); }
346
Mar 7, 2016
347
/**
348
* source: hint-sizes.scss
349
*
350
* Defines width restricted tooltips that can span
351
* across multiple lines.
352
*
353
* Classes added:
354
* 1) hint--small
355
* 2) hint--medium
356
* 3) hint--large
357
*
358
*/
359
.hint--small:after,
360
.hint--medium:after,
361
.hint--large:after {
362
white-space: normal;
Jul 28, 2016
363
line-height: 1.4em;
364
word-wrap: break-word; }
Mar 7, 2016
365
366
.hint--small:after {
367
width: 80px; }
368
369
.hint--medium:after {
370
width: 150px; }
371
372
.hint--large:after {
373
width: 300px; }
374
375
/**
376
* source: hint-always.scss
377
*
378
* Defines a persisted tooltip which shows always.
379
*
380
* Classes added:
381
* 1) hint--always
382
*
383
*/
384
.hint--always:after, .hint--always:before {
385
opacity: 1;
386
visibility: visible; }
Nov 22, 2015
387
Mar 26, 2016
388
.hint--always.hint--top:before {
389
-webkit-transform: translateY(-8px);
390
-moz-transform: translateY(-8px);
391
transform: translateY(-8px); }
392
393
.hint--always.hint--top:after {
Nov 22, 2015
394
-webkit-transform: translateX(-50%) translateY(-8px);
395
-moz-transform: translateX(-50%) translateY(-8px);
396
transform: translateX(-50%) translateY(-8px); }
397
Mar 26, 2016
398
.hint--always.hint--top-left:before {
399
-webkit-transform: translateY(-8px);
400
-moz-transform: translateY(-8px);
401
transform: translateY(-8px); }
402
403
.hint--always.hint--top-left:after {
Nov 22, 2015
404
-webkit-transform: translateX(-100%) translateY(-8px);
405
-moz-transform: translateX(-100%) translateY(-8px);
406
transform: translateX(-100%) translateY(-8px); }
407
Mar 26, 2016
408
.hint--always.hint--top-right:before {
409
-webkit-transform: translateY(-8px);
410
-moz-transform: translateY(-8px);
411
transform: translateY(-8px); }
412
413
.hint--always.hint--top-right:after {
414
-webkit-transform: translateY(-8px);
415
-moz-transform: translateY(-8px);
416
transform: translateY(-8px); }
Nov 22, 2015
417
Mar 26, 2016
418
.hint--always.hint--bottom:before {
419
-webkit-transform: translateY(8px);
420
-moz-transform: translateY(8px);
421
transform: translateY(8px); }
422
423
.hint--always.hint--bottom:after {
Nov 22, 2015
424
-webkit-transform: translateX(-50%) translateY(8px);
425
-moz-transform: translateX(-50%) translateY(8px);
426
transform: translateX(-50%) translateY(8px); }
427
Mar 26, 2016
428
.hint--always.hint--bottom-left:before {
429
-webkit-transform: translateY(8px);
430
-moz-transform: translateY(8px);
431
transform: translateY(8px); }
432
433
.hint--always.hint--bottom-left:after {
Nov 22, 2015
434
-webkit-transform: translateX(-100%) translateY(8px);
435
-moz-transform: translateX(-100%) translateY(8px);
436
transform: translateX(-100%) translateY(8px); }
437
Mar 26, 2016
438
.hint--always.hint--bottom-right:before {
439
-webkit-transform: translateY(8px);
440
-moz-transform: translateY(8px);
441
transform: translateY(8px); }
442
443
.hint--always.hint--bottom-right:after {
444
-webkit-transform: translateY(8px);
445
-moz-transform: translateY(8px);
446
transform: translateY(8px); }
Nov 22, 2015
447
Mar 26, 2016
448
.hint--always.hint--left:before {
449
-webkit-transform: translateX(-8px);
450
-moz-transform: translateX(-8px);
451
transform: translateX(-8px); }
452
453
.hint--always.hint--left:after {
454
-webkit-transform: translateX(-8px);
455
-moz-transform: translateX(-8px);
456
transform: translateX(-8px); }
Nov 22, 2015
457
Mar 26, 2016
458
.hint--always.hint--right:before {
459
-webkit-transform: translateX(8px);
460
-moz-transform: translateX(8px);
461
transform: translateX(8px); }
462
463
.hint--always.hint--right:after {
464
-webkit-transform: translateX(8px);
465
-moz-transform: translateX(8px);
466
transform: translateX(8px); }