/* ==================================================================================================================== Responsive Navs The main nav can be made fully responsive (with two layouts available) with js and some extra elements for better styling. Styleguide 15 ==================================================================================================================== */ @if $navs-responsive { .nav--responsive.active { @extend %nav--responsive !optional; } .nav--responsive.close { max-height: none; } #nav-toggle { @extend %nav__toggle !optional; display: none; float: $navs-responsive-dropdown-pos; } @include media($navs-responsive-breakpoint) { #nav-toggle { display: block; } // Reset styling of normal nav .nav.nav--responsive { display: block; margin: 0; overflow: hidden; zoom: 1; * { @include border-radius(0); background: transparent; border: 0; display: block; float: none; margin: 0; padding: 0; position: static; text-align: left; width: 100%; max-height: $dropdowns-height; opacity: 1; } } /* -------------------------------------------------------------------------------------------------------------------- SlideIn Layout Start by adding `.nav--responsive` to the nav and a container with `#nav-origin`. Example: a simple inline nav with 3 dropdowns:
Then add and empty div with `#nav-destination` for where the nav html will be moved when the media query kick in. At the bottom of the page add `responsive-nav.js`. This is a modified version of [Responsive Nav](http://responsive-nav.com/) with extra options. And finally in your js file add: // Enable responsive nav var navigation = responsiveNav("#nav"); // Move html on breakpoint function moveNavbar() { if ( $(".nav--responsive").css("overflow") == 'hidden' ) { $("#nav-destination").append($("#nav-origin .nav")); } else { $("#nav-origin").append($("#nav-destination .nav")); } } moveNavbar(); $(window).resize(function() { moveNavbar(); }); That's it, when the with of the page reace the breakpoint for the nav defined with `$navs-responsive-breakpoint` the html will be moved to the destination. Styleguide 15.1 -------------------------------------------------------------------------------------------------------------------- */ @if $navs-responsive-type == 'slide' { .nav--responsive { clip: rect(0 0 0 0); max-height: 0; width: 100%; &.opened { max-height: 9999px; } } } /* -------------------------------------------------------------------------------------------------------------------- Offset Layout First enable the layout: $navs-responsive-type: 'off-canvas'; The offset layout require two more wrappers `.external-wrapper` and `.internal-wrapper`, example below: