Skip to content

Commit dd075ad

Browse files
committed
Add tooltip on hamburger
1 parent 3576a96 commit dd075ad

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

app/assets/stylesheets/navbar.scss

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,31 @@ nav ul li {
2828
display: inline-block;
2929
padding: 20px;
3030
}
31+
32+
//tooltip for the hamburger on hover
33+
.tooltip {
34+
position: relative;
35+
}
36+
37+
.tooltip .tooltiptext {
38+
//positioning the tooltip
39+
width: 200px;
40+
bottom: 100%;
41+
left: 50%;
42+
margin-left: -30px;
43+
44+
display: none;
45+
//visibility: hidden;
46+
47+
font-size: small;
48+
background-color: $DJSlavender;
49+
color: #fff;
50+
text-align: center;
51+
padding: 5px 5px;
52+
border-radius: 6px;
53+
}
54+
55+
.tooltip:hover .tooltiptext {
56+
//visibility: visible;
57+
display: inline-flex;
58+
}

app/views/layouts/_navbar.html.erb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
</ul>
1010
</nav>
1111
<div class="account">
12-
<%=link_to "☰", '#' %>
12+
<div class="tooltip">
13+
<%=link_to "☰", '#' %>
14+
<div class="tooltiptext">
15+
In the course you will make the hamburger toggle with clean and DRY JavaScript!
16+
</div>
17+
</div>
1318
</div>
1419
</header>

0 commit comments

Comments
 (0)