Skip to content
This repository was archived by the owner on Sep 5, 2019. It is now read-only.

Commit 9e2aedc

Browse files
committed
Added tooltip
1 parent e9d45a8 commit 9e2aedc

File tree

5 files changed

+66
-10
lines changed

5 files changed

+66
-10
lines changed

src/css/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
@import url(style.dashboard.css);
1010
@import url(style.tables.css);
1111
@import url(style.modal.box.css);
12+
@import url(style.tooltip.css);
1213

1314
/*
1415
elements

src/css/style.dashboard.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
a.action-button {
104104
text-decoration: none;
105105
border-radius: 3px;
106-
padding: 2px 6px;
106+
padding: 2px 7px;
107107
display: inline-block;
108108
color: white;
109109
}

src/css/style.tables.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ table td:first-child {
1616
padding-left: 8px;
1717
}
1818

19+
table td {
20+
color: #575757;
21+
}
22+
1923
/*
2024
default
2125
*/

src/css/style.tooltip.css

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
/*
3+
tooltip
4+
*/
5+
[data-tooltip] {
6+
position: relative;
7+
z-index: 2;
8+
}
9+
10+
[data-tooltip]:before,
11+
[data-tooltip]:after {
12+
visibility: hidden;
13+
opacity: 0;
14+
}
15+
16+
[data-tooltip]:before {
17+
background-color: rgba(0, 0, 0, 0.95);
18+
border-radius: 3px;
19+
margin-bottom: 5px;
20+
margin-left: -50px;
21+
text-align: center;
22+
min-width: 100px;
23+
font-size: 1em;
24+
position: absolute;
25+
content: attr(data-tooltip);
26+
padding: 5px;
27+
bottom: 120%;
28+
color: #fff;
29+
left: 50%;
30+
}
31+
32+
33+
[data-tooltip]:after {
34+
border-right: 5px solid transparent;
35+
border-left: 5px solid transparent;
36+
margin-left: -5px;
37+
line-height: 0;
38+
border-top: 5px solid rgba(0, 0, 0, 0.95);
39+
font-size: 0;
40+
position: absolute;
41+
content: " ";
42+
bottom: 120%;
43+
width: 0;
44+
left: 50%;
45+
}
46+
47+
[data-tooltip]:hover:before,
48+
[data-tooltip]:hover:after {
49+
visibility: visible;
50+
opacity: 1;
51+
}

src/index.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,29 +172,29 @@ <h4>Table style</h4>
172172
<td>Root</td>
173173
<td>root@domain.com</td>
174174
<td>
175-
<a href="" class="action-button edit"><i class="fa fa-pencil"></i></a>
176-
<a href="" class="action-button delete"><i class="fa fa-trash"></i></a>
177-
<a href="#root" class="action-button detail"><i class="fa fa-search"></i></a>
175+
<a href="" class="action-button edit" data-tooltip="Edit"><i class="fa fa-pencil"></i></a>
176+
<a href="" class="action-button delete" data-tooltip="Delete"><i class="fa fa-trash"></i></a>
177+
<a href="#root" class="action-button detail" data-tooltip="Details"><i class="fa fa-search"></i></a>
178178
</td>
179179
</tr>
180180
<tr class="default">
181181
<td>2</td>
182182
<td>Admin</td>
183183
<td>admin@domain.com</td>
184184
<td>
185-
<a href="" class="action-button edit"><i class="fa fa-pencil"></i></a>
186-
<a href="" class="action-button delete"><i class="fa fa-trash"></i></a>
187-
<a href="#admin" class="action-button detail"><i class="fa fa-search"></i></a>
185+
<a href="" class="action-button edit" data-tooltip="Edit"><i class="fa fa-pencil"></i></a>
186+
<a href="" class="action-button delete" data-tooltip="Delete"><i class="fa fa-trash"></i></a>
187+
<a href="#root" class="action-button detail" data-tooltip="Details"><i class="fa fa-search"></i></a>
188188
</td>
189189
</tr>
190190
<tr class="default">
191191
<td>3</td>
192192
<td>User</td>
193193
<td>user@domain.com</td>
194194
<td>
195-
<a href="" class="action-button edit"><i class="fa fa-pencil"></i></a>
196-
<a href="" class="action-button delete"><i class="fa fa-trash"></i></a>
197-
<a href="#user" class="action-button detail"><i class="fa fa-search"></i></a>
195+
<a href="" class="action-button edit" data-tooltip="Edit"><i class="fa fa-pencil"></i></a>
196+
<a href="" class="action-button delete" data-tooltip="Delete"><i class="fa fa-trash"></i></a>
197+
<a href="#root" class="action-button detail" data-tooltip="Details"><i class="fa fa-search"></i></a>
198198
</td>
199199
</tr>
200200
</table>

0 commit comments

Comments
 (0)