Skip to content

Commit 183d20f

Browse files
committed
Make main nav more responsive
1 parent 5ea3d34 commit 183d20f

File tree

3 files changed

+32
-92
lines changed

3 files changed

+32
-92
lines changed

Diff for: css/app.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: js/_includes/menu.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ $.fn.mainNavigation = function(settings) {
4343
e.stopPropagation();
4444
e.preventDefault();
4545
var currentItem = $(this);
46-
console.log('enter');
46+
//console.log('enter');
4747
// Center the flyout menu
4848
var popup = currentItem.find( settings.popupSelector );
4949
if ( popup.find('.nav-section').length ) {
@@ -65,7 +65,7 @@ $.fn.mainNavigation = function(settings) {
6565
var handleMenuMouseLeave = function (e) {
6666
e.stopPropagation();
6767
e.preventDefault();
68-
console.log('leave');
68+
//console.log('leave');
6969
var currentItem = $(this);
7070

7171
hidePopup( currentItem );
@@ -80,7 +80,7 @@ $.fn.mainNavigation = function(settings) {
8080
}
8181

8282
var handleLastLinkFocusOut = function (e) {
83-
console.log( $(this) );
83+
//console.log( $(this) );
8484
hidePopup ( $(this).closest( settings.popupSelector ) );
8585
}
8686

Diff for: scss/partials/_nav-main.scss

+28-88
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@
150150
padding: 0;
151151

152152
.nav-section-title {
153-
color: $brand-color;
153+
color: #888;
154154
text-transform: uppercase;
155155
letter-spacing: .1em;
156-
font-size: 14px;
156+
font-size: 12px;
157157
font-weight: 600;
158158
padding: 15px 20px 10px 20px;
159159
}
@@ -221,19 +221,6 @@
221221
width: 100%;
222222
}
223223

224-
/* TDD - Alternate menu appearance
225-
226-
.nav-main #subnav-wrap #subnav ul li a {
227-
font: 1em 'Open Sans',sans-serif;
228-
font-weight: 600;
229-
text-transform: none;
230-
padding: 11px 15px;
231-
outline: 0;
232-
background: none repeat scroll 0 0 #31302b;
233-
} */
234-
235-
236-
237224

238225
body.offcanvas-active {
239226
overflow: hidden;
@@ -245,7 +232,7 @@ body.offcanvas-active {
245232
position: fixed;
246233
transition: all .2s;
247234
margin: 0;
248-
top: 0;
235+
top: $header-height;
249236
right: 0;
250237
height: auto;
251238
max-height: 100%;
@@ -257,98 +244,51 @@ body.offcanvas-active {
257244
overflow: auto;
258245
display: none;
259246

260-
.offcanvas-active &.nav-main-mobile {
261-
display: block;
262-
}
263-
264-
li {
265-
width: 100%;
266-
border: none;
267-
border-bottom: 1px solid $light-gray-color;
247+
.nav-main-item > a {
248+
font-size: 18px;
249+
padding-left: 10px;
268250
}
269251

270-
li a, {
252+
.offcanvas-active &.nav-main-mobile {
271253
display: block;
272-
font-size: 16px;
273-
padding: 20px $header-height 20px 20px;
274-
}
275-
276-
li a, li a:hover {
277-
background: none;
278-
border: none;
279254
}
280255

281-
ul {
282-
padding-top: $header-height;
283-
}
284-
285-
// Second level menu
286-
ul ul {
287-
visibility: visible;
256+
.nav-popup {
257+
display: block;
288258
position: relative;
259+
opacity: 1;
260+
visibility: visible;
289261
left: 0;
290262
top: 0;
291-
opacity: 1;
292-
width: 100%;
293-
max-height: 0;
294-
padding: 0;
295-
margin: 0;
296-
border: none;
297-
overflow: hidden;
298-
transition: max-height 0.2s;
299263
box-shadow: none;
264+
border: none;
265+
}
300266

301-
li a {
302-
font-size: 14px;
303-
padding-left: 20px;
304-
}
305-
267+
.nav-section {
268+
padding-bottom: 16px;
306269
}
307-
.expanded ul {
308-
max-height: 999px;
270+
271+
.nav-main-separator {
272+
height: 1px;
273+
border-left: none;
274+
border-bottom: 1px solid #ccc;
275+
margin-bottom: 16px;
309276
}
310277

311-
.children-toggle {
312-
position: absolute;
313-
display: block;
314-
width: $header-height;
315-
height: 57px;
316-
border: none;
278+
279+
280+
li a, li a:hover {
317281
background: none;
318-
top:0;
319-
right: 0;
320-
z-index: 1;
321-
322-
&:after {
323-
width: 0;
324-
height: 0;
325-
margin: 0 auto;
326-
position: relative;
327-
top: 22px;
328-
border-style: solid;
329-
border-width: 8px 6px 0 6px;
330-
border-color: #333 transparent transparent transparent;
331-
display: block;
332-
content: '';
333-
transition: all .2s;
334-
}
282+
border: none;
335283
}
336284

337-
.expanded .children-toggle:after {
338-
transform: rotate(180deg);
285+
li a:active {
286+
background: #ccc;
339287
}
340288

341-
342289
}
343290

344-
/*
345-
.offcanvas-active .site-header,
346-
.offcanvas-active #gl-wrapper,
347-
.offcanvas-active #footer {
348-
//transform: translate(260px,0);
349-
}*/
350-
351-
}
291+
}// medium-screen
352292

353293
.nav-main-fader {
354294
background: rgba(0,0,0,0);

0 commit comments

Comments
 (0)