[d565449] | 1 | // stylelint-disable function-disallowed-list
|
---|
| 2 |
|
---|
| 3 | %offcanvas-css-vars {
|
---|
| 4 | // scss-docs-start offcanvas-css-vars
|
---|
| 5 | --#{$prefix}offcanvas-zindex: #{$zindex-offcanvas};
|
---|
| 6 | --#{$prefix}offcanvas-width: #{$offcanvas-horizontal-width};
|
---|
| 7 | --#{$prefix}offcanvas-height: #{$offcanvas-vertical-height};
|
---|
| 8 | --#{$prefix}offcanvas-padding-x: #{$offcanvas-padding-x};
|
---|
| 9 | --#{$prefix}offcanvas-padding-y: #{$offcanvas-padding-y};
|
---|
| 10 | --#{$prefix}offcanvas-color: #{$offcanvas-color};
|
---|
| 11 | --#{$prefix}offcanvas-bg: #{$offcanvas-bg-color};
|
---|
| 12 | --#{$prefix}offcanvas-border-width: #{$offcanvas-border-width};
|
---|
| 13 | --#{$prefix}offcanvas-border-color: #{$offcanvas-border-color};
|
---|
| 14 | --#{$prefix}offcanvas-box-shadow: #{$offcanvas-box-shadow};
|
---|
| 15 | --#{$prefix}offcanvas-transition: #{transform $offcanvas-transition-duration ease-in-out};
|
---|
| 16 | --#{$prefix}offcanvas-title-line-height: #{$offcanvas-title-line-height};
|
---|
| 17 | // scss-docs-end offcanvas-css-vars
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | @each $breakpoint in map-keys($grid-breakpoints) {
|
---|
| 21 | $next: breakpoint-next($breakpoint, $grid-breakpoints);
|
---|
| 22 | $infix: breakpoint-infix($next, $grid-breakpoints);
|
---|
| 23 |
|
---|
| 24 | .offcanvas#{$infix} {
|
---|
| 25 | @extend %offcanvas-css-vars;
|
---|
| 26 | }
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | @each $breakpoint in map-keys($grid-breakpoints) {
|
---|
| 30 | $next: breakpoint-next($breakpoint, $grid-breakpoints);
|
---|
| 31 | $infix: breakpoint-infix($next, $grid-breakpoints);
|
---|
| 32 |
|
---|
| 33 | .offcanvas#{$infix} {
|
---|
| 34 | @include media-breakpoint-down($next) {
|
---|
| 35 | position: fixed;
|
---|
| 36 | bottom: 0;
|
---|
| 37 | z-index: var(--#{$prefix}offcanvas-zindex);
|
---|
| 38 | display: flex;
|
---|
| 39 | flex-direction: column;
|
---|
| 40 | max-width: 100%;
|
---|
| 41 | color: var(--#{$prefix}offcanvas-color);
|
---|
| 42 | visibility: hidden;
|
---|
| 43 | background-color: var(--#{$prefix}offcanvas-bg);
|
---|
| 44 | background-clip: padding-box;
|
---|
| 45 | outline: 0;
|
---|
| 46 | @include box-shadow(var(--#{$prefix}offcanvas-box-shadow));
|
---|
| 47 | @include transition(var(--#{$prefix}offcanvas-transition));
|
---|
| 48 |
|
---|
| 49 | &.offcanvas-start {
|
---|
| 50 | top: 0;
|
---|
| 51 | left: 0;
|
---|
| 52 | width: var(--#{$prefix}offcanvas-width);
|
---|
| 53 | border-right: var(--#{$prefix}offcanvas-border-width) solid var(--#{$prefix}offcanvas-border-color);
|
---|
| 54 | transform: translateX(-100%);
|
---|
| 55 | }
|
---|
| 56 |
|
---|
| 57 | &.offcanvas-end {
|
---|
| 58 | top: 0;
|
---|
| 59 | right: 0;
|
---|
| 60 | width: var(--#{$prefix}offcanvas-width);
|
---|
| 61 | border-left: var(--#{$prefix}offcanvas-border-width) solid var(--#{$prefix}offcanvas-border-color);
|
---|
| 62 | transform: translateX(100%);
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | &.offcanvas-top {
|
---|
| 66 | top: 0;
|
---|
| 67 | right: 0;
|
---|
| 68 | left: 0;
|
---|
| 69 | height: var(--#{$prefix}offcanvas-height);
|
---|
| 70 | max-height: 100%;
|
---|
| 71 | border-bottom: var(--#{$prefix}offcanvas-border-width) solid var(--#{$prefix}offcanvas-border-color);
|
---|
| 72 | transform: translateY(-100%);
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | &.offcanvas-bottom {
|
---|
| 76 | right: 0;
|
---|
| 77 | left: 0;
|
---|
| 78 | height: var(--#{$prefix}offcanvas-height);
|
---|
| 79 | max-height: 100%;
|
---|
| 80 | border-top: var(--#{$prefix}offcanvas-border-width) solid var(--#{$prefix}offcanvas-border-color);
|
---|
| 81 | transform: translateY(100%);
|
---|
| 82 | }
|
---|
| 83 |
|
---|
| 84 | &.showing,
|
---|
| 85 | &.show:not(.hiding) {
|
---|
| 86 | transform: none;
|
---|
| 87 | }
|
---|
| 88 |
|
---|
| 89 | &.showing,
|
---|
| 90 | &.hiding,
|
---|
| 91 | &.show {
|
---|
| 92 | visibility: visible;
|
---|
| 93 | }
|
---|
| 94 | }
|
---|
| 95 |
|
---|
| 96 | @if not ($infix == "") {
|
---|
| 97 | @include media-breakpoint-up($next) {
|
---|
| 98 | --#{$prefix}offcanvas-height: auto;
|
---|
| 99 | --#{$prefix}offcanvas-border-width: 0;
|
---|
| 100 | background-color: transparent !important; // stylelint-disable-line declaration-no-important
|
---|
| 101 |
|
---|
| 102 | .offcanvas-header {
|
---|
| 103 | display: none;
|
---|
| 104 | }
|
---|
| 105 |
|
---|
| 106 | .offcanvas-body {
|
---|
| 107 | display: flex;
|
---|
| 108 | flex-grow: 0;
|
---|
| 109 | padding: 0;
|
---|
| 110 | overflow-y: visible;
|
---|
| 111 | // Reset `background-color` in case `.bg-*` classes are used in offcanvas
|
---|
| 112 | background-color: transparent !important; // stylelint-disable-line declaration-no-important
|
---|
| 113 | }
|
---|
| 114 | }
|
---|
| 115 | }
|
---|
| 116 | }
|
---|
| 117 | }
|
---|
| 118 |
|
---|
| 119 | .offcanvas-backdrop {
|
---|
| 120 | @include overlay-backdrop($zindex-offcanvas-backdrop, $offcanvas-backdrop-bg, $offcanvas-backdrop-opacity);
|
---|
| 121 | }
|
---|
| 122 |
|
---|
| 123 | .offcanvas-header {
|
---|
| 124 | display: flex;
|
---|
| 125 | align-items: center;
|
---|
| 126 | padding: var(--#{$prefix}offcanvas-padding-y) var(--#{$prefix}offcanvas-padding-x);
|
---|
| 127 |
|
---|
| 128 | .btn-close {
|
---|
| 129 | padding: calc(var(--#{$prefix}offcanvas-padding-y) * .5) calc(var(--#{$prefix}offcanvas-padding-x) * .5);
|
---|
| 130 | margin: calc(-.5 * var(--#{$prefix}offcanvas-padding-y)) calc(-.5 * var(--#{$prefix}offcanvas-padding-x)) calc(-.5 * var(--#{$prefix}offcanvas-padding-y)) auto;
|
---|
| 131 | }
|
---|
| 132 | }
|
---|
| 133 |
|
---|
| 134 | .offcanvas-title {
|
---|
| 135 | margin-bottom: 0;
|
---|
| 136 | line-height: var(--#{$prefix}offcanvas-title-line-height);
|
---|
| 137 | }
|
---|
| 138 |
|
---|
| 139 | .offcanvas-body {
|
---|
| 140 | flex-grow: 1;
|
---|
| 141 | padding: var(--#{$prefix}offcanvas-padding-y) var(--#{$prefix}offcanvas-padding-x);
|
---|
| 142 | overflow-y: auto;
|
---|
| 143 | }
|
---|