hint.css
1.45 KB
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
/*
* Defines the basic styling for the tooltip.
* Each tooltip is made of 2 parts:
* 1) body (:after)
* 2) arrow (:before)
*/
.hinted { position: relative; }
[data-hint] {
position: absolute;
display: inline-block;
visibility: hidden;
opacity: 0;
z-index: 1000000;
pointer-events: none;
-webkit-transition-delay: 400ms;
-moz-transition-delay: 400ms;
transition-delay: 400ms;
-webkit-transition: 0.3s ease;
-moz-transition: 0.3s ease;
transition: 0.3s ease;
display: none;
.default-font();
}
.hinted:hover [data-hint], .hinted:hover [data-hint]:after, .hinted:hover [data-hint]:before {
visibility: visible;
opacity: 1;
display: inline-block;
}
[data-hint]:before {
visibility: hidden;
opacity: 0;
position: absolute;
content: '';
background: transparent;
border: 6px solid transparent;
z-index: 1000001;
}
[data-hint]:after {
visibility: hidden;
opacity: 0;
position: absolute;
content: attr(data-hint);
background: #383838;
color: white;
text-shadow: 0 -1px 0px black;
padding: 8px 10px;
font-size: 12px;
line-height: 12px;
white-space: nowrap;
box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
}
/**
* top tooltip
*/
.hint-top {
left: 50%;
top: 6px;
}
.hint-top:before {
margin: 0 0 -6px -6px;
border-top-color: #383838;
}
.hint-top:after {
margin: 0 0 6px -18px;
}
.hint-top:before, .hint-top:after {
bottom: 100%;
}
.hinted:hover .hint-top, .hinted:focus .hint-top {
top: -2px;
}