Skip to content

Commit 00d6178

Browse files
committed
More advanced tooltip display
1 parent 2b3fb3f commit 00d6178

File tree

4 files changed

+321
-70
lines changed

4 files changed

+321
-70
lines changed
655 Bytes
Loading
646 Bytes
Loading

Enhancements/Clean Tooltips/tooltip.css

Lines changed: 63 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,41 @@
11
tooltip {
22
z-index: 50000;
3-
position: absolute;
43
text-align: center;
54
pointer-events: none;
5+
white-space: nowrap;
6+
position: absolute;
7+
position: fixed;
68
display: block;
79
}
810

9-
tooltip > content {
10-
display: block;
11+
tooltip > padding {
1112
background-color: white;
1213
-webkit-box-shadow: 0 0 4px 0 rgba(0,0,0,0.4);
1314
box-shadow: 0 0 4px 0 rgba(0,0,0,0.4);
15+
display: inline-block;
1416
border-radius: 4px;
15-
text-align: center;
1617
overflow: hidden;
18+
padding: 6px;
19+
}
20+
21+
tooltip > padding > viewport {
1722
max-width: 300px;
23+
display: block;
24+
overflow: auto;
25+
padding: 0px;
26+
}
27+
28+
tooltip > padding > viewport > content {
29+
display: block;
30+
white-space: normal;
31+
text-align: left;
1832
font-size: 14px;
19-
padding: 12px;
33+
padding: 6px;
34+
width: auto;
2035
color: #444;
2136
}
2237

23-
tooltip > content h1 {
38+
tooltip > padding > viewport > content h1 {
2439
margin: 0px;
2540
font-size: 120%;
2641
text-align: center;
@@ -29,7 +44,7 @@ tooltip > content h1 {
2944
margin-bottom: 2px;
3045
}
3146

32-
tooltip > content h2 {
47+
tooltip > padding > viewport > content h2 {
3348
margin: 0px;
3449
font-size: 12px;
3550
text-transform: uppercase;
@@ -73,11 +88,11 @@ tooltip > arrow {
7388
z-index: 500;
7489
position: relative;
7590
background: url({{/arrow-down.png}}) no-repeat;
76-
display: inline-block;
91+
display: block;
7792
top: -2px;
7893
}
7994

80-
tooltip > arrow.flip {
95+
tooltip > arrow.vflip {
8196
display: none;
8297
top: 3px;
8398
}
@@ -86,12 +101,49 @@ tooltip.flipped > arrow {
86101
display: none;
87102
}
88103

89-
tooltip.flipped > arrow.flip {
90-
display: inline-block;
104+
tooltip.flipped > arrow.vflip {
105+
display: block;
91106
background: url({{/arrow-up.png}}) no-repeat;
92107
top: 3px;
93108
}
94109

110+
tooltip.xlock > arrow,
111+
tooltip.xlock > arrow.vflip {
112+
display: none;
113+
}
114+
115+
tooltip > arrow.xflip {
116+
display: none;
117+
}
118+
119+
tooltip.xlock > arrow.xflip {
120+
left: 24px;
121+
width: 20px;
122+
height: 34px;
123+
background: url({{/arrow-right.png}}) no-repeat;
124+
display: inline-block;
125+
float: right;
126+
}
127+
128+
tooltip.xlock.flipped > arrow.xflip {
129+
display: none;
130+
}
131+
132+
tooltip.xlock.flipped > arrow.xflip.hflip {
133+
background: url({{/arrow-left.png}}) no-repeat;
134+
display: inline-block;
135+
float: left;
136+
left: 0px;
137+
}
138+
139+
tooltip.xlock > content {
140+
margin-right: -24px;
141+
}
142+
143+
tooltip.xlock > arrow.xflip.hflip {
144+
display: none;
145+
}
146+
95147
tooltip label {
96148
display: block;
97149
font-size: 80%;

0 commit comments

Comments
 (0)