Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Foundation 5 off-canvas transformation

Is there a way to transform the off-canvas navigation in Foundation 5 to a sidebar navigation? For example the official Foundation 5 docs use visibility classes, but doesn't this kinda defeat the purpose, because of having two separate navigations?

I want to achieve something like this with Foundation 5:

enter image description here

like image 620
WhatIsName Avatar asked Dec 07 '13 12:12

WhatIsName


2 Answers

You can do it by overriding the off-canvas CSS rules. Here is a beginning of a solution:

@media (min-width: 700px) {
    .left-off-canvas-menu,
    .right-off-canvas-menu {
        position: static;
        transform: none;
        float: left;
    }
    .move-right > .inner-wrap {
        transform: none;
    }
    .main-section {
        overflow: hidden;
    }
}

You can play with this code on this jsfiddle.

Cheers, Thomas.

like image 66
tzi Avatar answered Sep 19 '22 22:09

tzi


The solution is actually much simpler:

@media (min-width: 700px) {
    div.off-canvas-wrap {
      > .inner-wrap {
        @include translate3d($off-canvas-width,0,0);
      }
    }
    div.exit-off-canvas { display: none; }
}
like image 30
LauriE Avatar answered Sep 21 '22 22:09

LauriE