Skip to content

Commit 456db77

Browse files
committed
Merge pull request sendgrid#195 from sendgrid/collapsed-responsive-nav
collapsed responsive nav
2 parents 9af0c44 + c68cd53 commit 456db77

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

source/javascripts/menu.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,10 @@ $(function() {
4444
dataType: "jsonp"
4545
});
4646

47+
$(".sidebar-nav").click(function (e) {
48+
if(e.target == this){
49+
$(this).toggleClass("shown");
50+
}
51+
});
52+
4753
});

source/stylesheets/style.css

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,39 @@ body:before {
172172
margin-top:-32767px;/
173173
}
174174

175+
.sidebar-nav {
176+
height: 45px;
177+
margin-bottom: 10px;
178+
background-color: #f5f5f5;
179+
border: 1px solid #eee;
180+
border: 1px solid rgba(0,0,0,0.05);
181+
-webkit-border-radius: 4px;
182+
-moz-border-radius: 4px;
183+
border-radius: 4px;
184+
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
185+
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
186+
box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
187+
}
188+
.sidebar-nav:before {
189+
display: block;
190+
padding: 10px;
191+
cursor: pointer;
192+
content: "Menu";
193+
font-size: 15px;
194+
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
195+
font-weight: bold;
196+
color: #08c;
197+
}
198+
.sidebar-nav:hover, .sidebar-nav.shown {
199+
height: auto;
200+
}
201+
.sidebar-nav #nav-menu {
202+
display: none;
203+
}
204+
.sidebar-nav:hover #nav-menu, .sidebar-nav.shown #nav-menu {
205+
display: block;
206+
}
207+
175208
.sidebar-nav > #nav-menu { border-right: 1px solid #ddd; font-size: 18px; line-height:21px; }
176209

177210
.callout > a { color: rgb(240, 132, 2); }
@@ -243,3 +276,25 @@ li.official {
243276
width: 100%;
244277
height: 100%;
245278
}
279+
280+
@media (min-width: 767px) {
281+
.sidebar-nav {
282+
background: transparent;
283+
margin: 0;
284+
border: none;
285+
-webkit-border-radius: 0;
286+
-moz-border-radius: 0;
287+
border-radius: 0;
288+
-webkit-box-shadow: none;
289+
-moz-box-shadow: none;
290+
box-shadow: none;
291+
}
292+
.sidebar-nav:before {
293+
content: "";
294+
top: 0;
295+
left: 0;
296+
}
297+
.sidebar-nav #nav-menu {
298+
display: block;
299+
}
300+
}

0 commit comments

Comments
 (0)