_tooltips.scss
2.6 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
$multiline-max-width: 250px;
$tooltip-background-color: rgba(0, 0, 0, 0.8);
$tooltip-text-color: #fff;
.tooltipped {
position: relative;
}
// This is the tooltip bubble
.tooltipped:after {
position: absolute;
z-index: 1000000;
display: none;
padding: 5px 8px;
font: normal normal 11px/1.5 $font-family-default;
color: $tooltip-text-color;
text-align: center;
text-decoration: none;
text-shadow: none;
text-transform: none;
letter-spacing: normal;
word-wrap: break-word;
white-space: pre;
pointer-events: none;
content: attr(aria-label);
background: $tooltip-background-color;
border-radius: 3px;
-webkit-font-smoothing: subpixel-antialiased;
}
// This is the tooltip arrow
.tooltipped:before {
position: absolute;
z-index: 1000001;
display: none;
width: 0;
height: 0;
color: $tooltip-background-color;
pointer-events: none;
content: "";
border: 5px solid transparent;
}
// This will indicate when we'll activate the tooltip
.tooltipped:hover,
.tooltipped:active,
.tooltipped:focus {
&:before,
&:after {
display: inline-block;
text-decoration: none;
}
}
// Tooltipped south
.tooltipped-s,
.tooltipped-se,
.tooltipped-sw {
&:after {
top: 100%;
right: 50%;
margin-top: 5px;
}
&:before {
top: auto;
right: 50%;
bottom: -5px;
margin-right: -5px;
border-bottom-color: $tooltip-background-color;
}
}
.tooltipped-se {
&:after {
right: auto;
left: 50%;
margin-left: -15px;
}
}
.tooltipped-sw:after {
margin-right: -15px;
}
// Tooltips above the object
.tooltipped-n,
.tooltipped-ne,
.tooltipped-nw {
&:after {
right: 50%;
bottom: 100%;
margin-bottom: 5px;
}
&:before {
top: -5px;
right: 50%;
bottom: auto;
margin-right: -5px;
border-top-color: $tooltip-background-color;
}
}
.tooltipped-ne {
&:after {
right: auto;
left: 50%;
margin-left: -15px;
}
}
.tooltipped-nw:after {
margin-right: -15px;
}
// Move the tooltip body to the center of the object.
.tooltipped-s:after,
.tooltipped-n:after {
transform: translateX(50%);
}
// Tooltipped to the left
.tooltipped-w {
&:after {
right: 100%;
bottom: 50%;
margin-right: 5px;
transform: translateY(50%);
}
&:before {
top: 50%;
bottom: 50%;
left: -5px;
margin-top: -5px;
border-left-color: $tooltip-background-color;
}
}
// tooltipped to the right
.tooltipped-e {
&:after {
bottom: 50%;
left: 100%;
margin-left: 5px;
transform: translateY(50%);
}
&:before {
top: 50%;
right: -5px;
bottom: 50%;
margin-top: -5px;
border-right-color: $tooltip-background-color;
}
}