forked from eschutho/tooltip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtooltip.scss
80 lines (78 loc) · 1.38 KB
/
tooltip.scss
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
.tooltip {
display:none;
position:absolute;
behavior: url("/assets/PIE.htc");
border: 1px solid $blue3;
@include border-radius(4px);
@include box-shadow(0px 2px 4px rgba(128, 128, 128, .4));
width:300px;
@media(max(403)) {
width:250px;
}
.tooltip-body {
background-color: $blue1;
position: relative;
behavior: url("/assets/PIE.htc");
@include border-radius(3px);
box-sizing: border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
padding: 16px;
z-index: 1;
}
.notch {
position: absolute;
top: -10px;
left: 20px;
margin: 0;
border: 1px solid $blue3;
@include rotatedBox(45deg, 20px, 20px);
background-color: $blue1;
@include box-shadow(0 2px 4px rgba(128, 128, 128, .4));
}
// set the vertical placement
&.bottomleft, &.bottomcenter, &.bottomright {
.notch {
top: -10px;
}
}
&.topleft, &.topcenter, &.topright {
.notch {
bottom: -10px;
top: auto;
}
}
// set the horizontal placement
&.topleft, &.bottomleft {
left:auto;
right:20px;
}
}
&.topright, &.bottomright {
.notch {
right:auto;
left:20px;
}
}
&.topcenter, &.bottomcenter {
.notch {
left:47%;
}
}
&.left {
margin-top: -9px; /* diagonal of tooltip - line height */
.notch {
right: -10px;
top: 20px;
left:auto;
}
}
&.right {
margin-top: -9px;
.notch {
left: -10px;
top: 20px;
right:auto;
}
}
}