-
Notifications
You must be signed in to change notification settings - Fork 8
/
simpleTooltip.css
106 lines (106 loc) · 2.2 KB
/
simpleTooltip.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
/* simpleTooltip by BR0kEN */
#hintwidth {
position: absolute;
visibility: hidden;
left: -100000000px;
}
#hintwidth, [data-shift]:before, [data-shift]:after {
font: normal 11px/16px Arial;
}
[data-shift]:before, [data-shift]:after {
display: none;
}
[data-shift]:before, [data-shift]:after {
position: absolute;
z-index: 2000;
}
[data-shift]:before {
content: attr(data-title);
color: #fff;
text-align: left;
padding: 4px 5px;
border-radius: 2px;
white-space: nowrap;
background: rgba(0, 0, 0, 0.8);
}
[data-shift]:after {
content: '';
width: 0;
height: 0;
pointer-events: none;
border: 5px solid transparent;
}
[data-shift]:hover:before, [data-shift]:hover:after {
display: block;
}
/* direction => NW & NE */
[data-shift^=n]:before, [data-shift^=n]:after {
top: 100%;
}
[data-shift^=n]:before {
margin-top: 5px;
}
[data-shift^=n]:after {
margin-top: -5px;
border-bottom-color: rgba(0, 0, 0, 0.8);
}
/* direction => SE & SW */
[data-shift^=s]:before, [data-shift^=s]:after {
bottom: 100%;
}
[data-shift^=s]:before {
margin-bottom: 5px;
}
[data-shift^=s]:after {
margin-bottom: -5px;
border-top-color: rgba(0, 0, 0, 0.8);
}
/* direction => NW & NE & SW & SE & North & South */
[data-shift$=w]:before, [data-shift$=w]:after, [data-shift$=th]:before, [data-shift$=th]:after {
left: 50%;
}
[data-shift$=w]:before {
margin-left: -15px;
}
[data-shift$=w]:after, [data-shift$=th]:after {
margin-left: -5px;
}
[data-shift$=e]:before, [data-shift$=e]:after {
right: 50%;
}
[data-shift$=e]:before {
margin-right: -15px;
}
[data-shift$=e]:after {
margin-right: -5px;
}
/* direction => East & West */
[data-shift$=st]:before, [data-shift$=st]:after {
bottom: 50%;
}
[data-shift$=st]:after {
margin-bottom: -5px;
}
[data-shift$=st]:before {
margin-bottom: -12px;
}
[data-shift=west]:before, [data-shift=west]:after {
left: 100%;
}
[data-shift=west]:before {
margin-left: 10px;
}
[data-shift=west]:after {
margin-right: -10px;
border-right-color: rgba(0, 0, 0, 0.8);
}
[data-shift=east]:before, [data-shift=east]:after {
right: 100%;
}
[data-shift=east]:before {
margin-right: 10px;
}
[data-shift=east]:after {
margin-left: -10px;
border-left-color: rgba(0, 0, 0, 0.8);
}