5 A generic container that stays fixed to the left, top, right, or bottom of the screen, and is summoned when needed. When an off-canvas panel is open, the app frame shifts over to reveal the menu.
\r
8 /// @Foundation.settings
\r
10 $offcanvas-size-horizontal: 250px !default;
\r
11 $offcanvas-size-vertical: 250px !default;
\r
13 $offcanvas-background: #fff !default;
\r
14 $offcanvas-color: isitlight($offcanvas-background) !default;
\r
15 $offcanvas-padding: 0 !default;
\r
16 $offcanvas-shadow: 3px 0 10px rgba(black, 0.25) !default;
\r
17 $offcanvas-animation-speed: 0.25s !default;
\r
19 $offcanvas-frame-selector: '.grid-frame' !default;
\r
25 -webkit-overflow-scrolling: touch;
\r
26 transition: transform $offcanvas-animation-speed ease-out;
\r
31 transform: translate(0,0) !important;
\r
35 & ~ #{$offcanvas-frame-selector} {
\r
36 transform: translate(0,0,0);
\r
37 transition: transform 0.25s ease-out;
\r
38 backface-visibility: hidden;
\r
42 @mixin off-canvas-detached {
\r
50 & ~ #{$offcanvas-frame-selector} {
\r
52 box-shadow: 0 0 15px rgba(0,0,0,0.5);
\r
56 @mixin off-canvas-layout(
\r
59 $shadow: $offcanvas-shadow
\r
62 Get shadow values for later use
\r
67 @if hasvalue($shadow) {
\r
68 $shadow-length: get-shadow-value($shadow, x);
\r
69 $shadow-size: get-shadow-value($shadow, size);
\r
70 $shadow-color: get-shadow-value($shadow, color);
\r
76 @if $position == left or $position == right {
\r
77 @if $size == default {
\r
78 $size: $offcanvas-size-horizontal;
\r
84 @if $size == default {
\r
85 $size: $offcanvas-size-vertical;
\r
94 @if $position == left {
\r
97 @if hasvalue($shadow) { box-shadow: inset (-$shadow-length) 0 $shadow-size $shadow-color; }
\r
98 transform: translateX(-100%);
\r
100 & ~ #{$offcanvas-frame-selector} { transform: translateX($size) !important; }
\r
103 @else if $position == right {
\r
107 @if hasvalue($shadow) { box-shadow: inset $shadow-length 0 $shadow-size $shadow-color; }
\r
108 transform: translateX(100%);
\r
110 & ~ #{$offcanvas-frame-selector} { transform: translateX(-$size) !important; }
\r
113 @else if $position == top {
\r
116 transform: translateY(-100%);
\r
117 @if hasvalue($shadow) { box-shadow: inset 0 (-$shadow-length) $shadow-size $shadow-color; }
\r
119 & ~ #{$offcanvas-frame-selector} { transform: translateY($size) !important; }
\r
122 @else if $position == bottom {
\r
126 transform: translateY(100%);
\r
127 @if hasvalue($shadow) { box-shadow: inset 0 $shadow-length $shadow-size $shadow-color; }
\r
129 & ~ #{$offcanvas-frame-selector} { transform: translateY(-$size) !important; }
\r
134 @mixin off-canvas-style(
\r
135 $background: $offcanvas-background,
\r
136 $color: $offcanvas-color,
\r
137 $padding: $offcanvas-padding
\r
139 background: $background;
\r
141 @if $color == auto {
\r
142 color: isitlight($background, #000, #fff);
\r
148 @if hasvalue($padding) {
\r
153 @include exports(off-canvas) {
\r
155 @extend %off-canvas;
\r
156 @include off-canvas-layout;
\r
157 @include off-canvas-style;
\r
159 &.top { @include off-canvas-layout(top); }
\r
160 &.right { @include off-canvas-layout(right); }
\r
161 &.bottom { @include off-canvas-layout(bottom); }
\r
162 &.left { @include off-canvas-layout(left); }
\r
164 &.detached { @include off-canvas-detached; }
\r
166 &.primary { @include off-canvas-style($primary-color, auto); }
\r
167 &.dark { @include off-canvas-style($dark-color, auto); }
\r