forked from lazerwalker/TipsterJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tipster.scss
76 lines (63 loc) · 1.69 KB
/
tipster.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
@import "compass";
@import "constants";
div.tooltip {
@include border-radius(5px);
@include box-shadow(7px, #000);
$tail-color: rgba(0,0,0,0.8);
$tail-size: 12px;
background: rgba(0,0,0,0.8);
color: #FFF;
padding: 5px;
position: absolute;
height: auto;
width: 0px;
div.tail {
position: absolute;
padding: 0;
width: 0px;
height: 0px;
border: $tail-size solid transparent; }
/* The lol-iest of hacks.
* If we just give .tail a box-shadow, the box extends beyond the triangle.
* By creating a smaller box within the tail and giving *that* a shadow, we get the shadow we want. */
div.shadow {
width: 0px;
height: 10px;
@include box-shadow(12px, #000);
position:absolute; }
&.right .tail {
border-left: none;
border-right-color: $tail-color;
right: 100%;
top: 50%;
margin-top: -$tail-size;
.shadow {
top: -5px;
left: 4px } }
&.left .tail {
border-right: none;
border-left-color: $tail-color;
left: 100%;
top: 50%;
margin-top: -$tail-size;
.shadow {
top: -5px;
right: 4px } }
&.top .tail {
border-bottom: none;
border-top-color: $tail-color;
top: 100%;
left: 50%;
margin-left: -$tail-size;
.shadow {
left: -5px;
bottom: 4px; } }
&.bottom .tail {
border-top: none;
border-bottom-color: $tail-color;
bottom: 100%;
left: 50%;
margin-left: -$tail-size;
.shadow {
left: -5px;
top: 4px; } } }