/// @type Color
$offcanvas-background: $light-gray !default;
+/// If `true`, an off-canvas panel will be fixed-position, and scroll with the screen. Otherwise it will be absolute positioned.
+/// @type Bool
+$offcanvas-fixed: true !default;
+
/// Z-index of an off-canvas panel with the `push` transition.
/// @type Number
$offcanvas-push-zindex: 1 !default;
$offcanvas-transition-timing: ease !default;
/// If `true`, a revealed off-canvas will be fixed-position, and scroll with the screen.
+/// @type Bool
$offcanvas-fixed-reveal: true !default;
/// Background color for the overlay that appears when an off-canvas panel is open.
/// Adds basic styles for an off-canvas panel.
@mixin off-canvas-base(
$background: $offcanvas-background,
- $transition: $offcanvas-transition-length $offcanvas-transition-timing
+ $transition: $offcanvas-transition-length $offcanvas-transition-timing,
+ $fixed: $offcanvas-fixed
) {
@include disable-mouse-outline;
- position: fixed;
+ @if $fixed == true {
+ position: fixed;
+ }
+ @else {
+ position: absolute;
+ }
+
z-index: $offcanvas-push-zindex;
- transition: transform $transition;
+ transition: transform $transition, box-shadow $transition;
backface-visibility: hidden;
background: $background;
+ // Push only styles.
+ &.is-transition-push {
+ box-shadow: inset $offcanvas-shadow;
+ }
+
// Overlap only styles.
&.is-transition-overlap {
z-index: $offcanvas-overlap-zindex;
width: $size;
height: 100%;
- transform: translateX(-$size);
+ transform: translateX(-100%);
overflow-y: auto;
// Sets the open position for the content
width: $size;
height: 100%;
- transform: translateX($size);
+ transform: translateX(100%);
overflow-y: auto;
// Sets the open position for the content
width: 100%;
height: $size;
- transform: translateY(-$size);
+ transform: translateY(-100%);
overflow-x: auto;
// Sets the open position for the content
width: 100%;
height: $size;
- transform: translateY($size);
+ transform: translateY(100%);
overflow-x: auto;
// Sets the open position for the content
backface-visibility: hidden;
background: $background;
-
- .is-off-canvas-open & {
- box-shadow: $offcanvas-shadow;
- }
}
/// Adds styles that reveal an off-canvas panel.
@include off-canvas-content;
}
- // Reveal off-canvas panel on larger screens @TODO
+ // Reveal off-canvas panel on larger screens
@each $name, $value in $breakpoint-classes {
@if $name != $-zf-zero-breakpoint {
@include breakpoint($name) {