This repository has been archived by the owner on Mar 17, 2023. It is now read-only.
forked from yutakahoulette-zz/data-tooltip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.css
132 lines (98 loc) · 2.77 KB
/
index.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
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
/* the :before pseudo-element contains the triangle */
/* the :after pseudo-element contains the text */
[class*=tooltip--] {
position: relative;
}
[class*=tooltip--]:before,
[class*=tooltip--]:after {
position: absolute;
visibility: hidden;
opacity: 0;
pointer-events: none;
box-sizing: border-box;
transition: .1s ease;
transition-delay: 0s;
}
.tooltip--show:before,
.tooltip--show:after,
[class*=tooltip--]:hover:before,
[class*=tooltip--]:hover:after {
visibility: visible;
opacity: 1;
transition-delay: .1s;
}
[class*=tooltip--]:before {
content: '';
position: absolute;
background: transparent;
height: 6px;
width: 6px;
border: 6px solid transparent;
}
[class*=tooltip--]:after {
background: #383838;
font-weight: normal;
color: white;
padding: 6px 8px;
font-size: .75rem;
line-height: 1.4;
white-space: nowrap;
box-shadow: 1px 1px 4px 1px rgba(0,0,0,.2);
border-radius: 3px;
text-align: left;
content: attr(data-tooltip);
}
[class*=tooltip--top]:before { border-top-color: #383838; }
[class*=tooltip--bottom]:before { border-bottom-color: #383838; }
.tooltip--left:before { border-left-color: #383838; }
.tooltip--right:before { border-right-color: #383838; }
[class*=tooltip--top]:before { bottom: calc(100% - 6px) }
[class*=tooltip--top]:after { bottom: calc(100% + 6px) }
.tooltip--top:before {
left: 50%;
margin-left: -6px;
}
.tooltip--top:after {
left: 50%;
transform: translateX(-50%);
}
[class*=tooltip--bottom]:before { top: calc(100% - 6px) }
[class*=tooltip--bottom]:after { top: calc(100% + 6px) }
.tooltip--bottom:before { left: calc(50% - 6px); }
.tooltip--bottom:after {
left: 50%;
transform: translateX(-50%);
}
.tooltip--topLeft:after,
.tooltip--bottomLeft:after { left: 0; }
.tooltip--bottomLeft:before,
.tooltip--topLeft:before { left: 12px; }
.tooltip--bottomRight:before,
.tooltip--topRight:before { right: 12px; }
.tooltip--bottomRight:after,
.tooltip--topRight:after { right: 0; }
.tooltip--right:before { transform: translateX(-12px); }
.tooltip--left:before { transform: translateX(12px); }
.tooltip--left:before,
.tooltip--right:before { margin-bottom: -6px; }
.tooltip--left:after,
.tooltip--right:after { margin-bottom: -15px; }
.tooltip--right:before,
.tooltip--right:after { left: calc(100% + 5px); }
.tooltip--left:before,
.tooltip--left:after { right: calc(100% + 6px); }
.tooltip--left:before,
.tooltip--left:after,
.tooltip--right:before,
.tooltip--right:after { bottom: 50%; }
.tooltip--small:after,
.tooltip--medium:after,
.tooltip--large:after,
.tooltip--full:after {
white-space: normal;
word-wrap: break-word;
}
.tooltip--small:after { width: 100px; }
.tooltip--medium:after { width: 150px; }
.tooltip--large:after { width: 300px; }
.tooltip--full:after { width: 100%; }