$offcanvas-menu-background: $secondary-color !default; $offcanvas-menu-color: $white !default; $offcanvas-menu-item-color-active: $menu-item-color-active !default; $offcanvas-menu-item-background-active: $menu-item-background-active !default; $offcanvas-menu-border: none !default; $offcanvas-menu-collapsed-size: 4.1rem !default; $offcanvas-menu-submenu-background: darken($offcanvas-menu-background, 3) !default; // Offcanvas Menu Mixins @mixin off-canvas-menu-wrapper { @include xy-grid(horizontal, false); @include off-canvas-wrapper; min-height: 100vh; } @mixin off-canvas-menu-content { @include xy-cell(auto, false); @extend .#{$maincontent-class}; max-width: 100%; overflow-x: auto; min-width: 240px; @include breakpoint(large) { margin: 0; transform: none !important; transition: none !important; } } @mixin off-canvas-menu-header { padding-left: 1.5rem; padding-right: 1.5rem; border-color: $offcanvas-menu-background; justify-content: flex-start; .logo-small { display: none; width: 100%; text-align: center; } @include breakpoint(large) { @at-root .is-collapsed#{&} { white-space: nowrap; width: $offcanvas-menu-collapsed-size; padding-left: 0; padding-right: 0; justify-content: center; span { display: none; } .logo-big { display: none; } .logo-small { display: block; } } } } @mixin offcanvas-menu-dot { border: 0; width: 8px; height: 8px; border-radius: 50%; background: rgba($offcanvas-menu-color, 0.1); } @mixin offcanvas-menu-basics { &.secondary { li { &:hover, &.is-active { > a { color: $offcanvas-menu-item-color-active; background: transparent; } } &.is-current { > a { color: $offcanvas-menu-item-color-active; background: $offcanvas-menu-item-background-active; } } } a { color: rgba($offcanvas-menu-color, .6); text-transform: uppercase; } } a { color: $offcanvas-menu-color; font-size: .9rem; padding-left: 1.5rem; padding-right: 1.5rem; outline: 0; } .submenu { background: $offcanvas-menu-submenu-background; margin: 0; } @include breakpoint(large) { @at-root .off-canvas-menu.is-collapsed > .menu:not(.icons) { display: none; } } } @mixin offcanvas-menu-icons { &.icons { i { font-size: 1.2rem; position: relative; width: 1.2rem; &:before { @include vertical-center; } } } &.icon-left { i { margin-right: .7rem; } } &.icon-right { a { padding-right: 40px; position: relative; i { @include vertical-center; left: calc(100% - 45px); } } } @include breakpoint(large) { @at-root .off-canvas-menu.is-collapsed > .menu { > li { > a { overflow: hidden; white-space: nowrap; width: $offcanvas-menu-collapsed-size; padding-left: 0; padding-right: 0; > i { position: relative; transform: none; margin: 0 auto; left: 0; width: 0; &:before { @include absolute-center; } } > span { width: 0; opacity: 0; overflow: hidden; } } } } } } @mixin off-canvas-menu-style { > li { border-bottom: 1px solid rgba($offcanvas-menu-color, .04); &:hover, &.is-active { > a { box-shadow: inset 3px 0 0 $offcanvas-menu-color; color: $offcanvas-menu-item-color-active; background: transparent; } } &.is-current { > a { box-shadow: inset 3px 0 0 $offcanvas-menu-item-background-active; color: $offcanvas-menu-item-color-active; background: transparent; } } &:last-child { border-bottom: 0; } > a { padding-top: 1.1rem; padding-bottom: 1.1rem; } } a { padding-top: 1rem; padding-bottom: 1rem; } } @mixin off-canvas-menu-accordion { @include off-canvas-menu-style; > li { &:last-child { > .submenu { box-shadow: 0 1px 0 rgba($offcanvas-menu-color, .04), 0 -1px 0 rgba($offcanvas-menu-color, .04); } } > .submenu { padding: .5rem 0; box-shadow: 0 -1px 0 rgba($offcanvas-menu-color, .04); .submenu { background: rgba(darken($offcanvas-menu-background, 15), 0.1); box-shadow: 0 -1px 0 rgba($offcanvas-menu-color, .02), 0 1px 0 rgba($offcanvas-menu-color, .02); } } > .submenu-toggle { height: 50px; } } .submenu-toggle { height: 45px; padding-right: .8rem; outline: none; &:after { @include offcanvas-menu-dot; } } @include breakpoint(large) { @at-root .is-collapsed#{&} { display: none; } } } @mixin off-canvas-menu-dropdown { @include off-canvas-menu-style; > li { > a:after { display: none !important; } } .is-active > a { color: $offcanvas-menu-item-color-active; } .is-dropdown-submenu .is-dropdown-submenu-parent > a::after { @include offcanvas-menu-dot; margin-top: -3px; right: 18px; } .submenu { padding: .17rem 0; border: 0; margin-top: -1px; } } @mixin off-canvas-menu { @include xy-cell(shrink, false); @include off-canvas-base; background: $offcanvas-menu-background; @each $name, $size in $offcanvas-sizes { @include breakpoint($name) { width: $size; } } @include breakpoint(large) { @include in-canvas; background: $offcanvas-menu-background; visibility: visible !important; transition: none !important; overflow: visible !important; @each $name, $size in $offcanvas-sizes { width: $size; } &.is-collapsed { width: $offcanvas-menu-collapsed-size; .collapse-show { display: block; } } } .collapse-show { display: none; } &.position-right { border-left: $offcanvas-menu-border; } &.position-left { border-right: $offcanvas-menu-border; } } // Offcanvas Menu Component @mixin bedrock-off-canvas-menu { .off-canvas-menu-wrapper { @include off-canvas-menu-wrapper; } .off-canvas-menu-content { @include off-canvas-menu-content; } .off-canvas-menu { @include off-canvas-menu; > .logo-bar { @include off-canvas-menu-header; } > .accordion-menu { @include off-canvas-menu-accordion; } > .dropdown.menu { @include off-canvas-menu-dropdown; } .menu { @include offcanvas-menu-basics; @include offcanvas-menu-icons; } } }