| 1 |
/******************************************************************************* |
| 2 |
* Rules for the UX/UI of sidebar sliding drawers on mobile |
| 3 |
* Note that this sheet controls styles across many parts of the theme |
| 4 |
* It is aggregated into this one sheet instead of being split across |
| 5 |
* components in order to keep it easier to debug in one place. |
| 6 |
* It is broken up into major sections below. |
| 7 |
*/ |
| 8 |
|
| 9 |
/******************************************************************************* |
| 10 |
* Sidebar drawer behavior |
| 11 |
*/ |
| 12 |
|
| 13 |
/** |
| 14 |
* NOTE: We use this mixin to define the toggle behavior on narrow screens, |
| 15 |
* And the wide-screen behavior of the sections is defined in their own section |
| 16 |
* .scss files. |
| 17 |
*/ |
| 18 |
@mixin sliding-drawer($side: "left") { |
| 19 |
position: fixed; |
| 20 |
top: 0; |
| 21 |
z-index: $zindex-modal; |
| 22 |
height: 100vh; |
| 23 |
max-height: 100vh; |
| 24 |
width: 75%; |
| 25 |
flex-grow: 0.75; |
| 26 |
max-width: 350px; |
| 27 |
transition: |
| 28 |
visibility $animation-time ease-out, |
| 29 |
margin $animation-time ease-out; |
| 30 |
visibility: hidden; |
| 31 |
border: 0; |
| 32 |
|
| 33 |
@if $side == "right" { |
| 34 |
margin-right: -75%; |
| 35 |
right: 0; |
| 36 |
} @else { |
| 37 |
margin-left: -75%; |
| 38 |
left: 0; |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
.bd-sidebar::backdrop { |
| 43 |
background-color: black; |
| 44 |
opacity: 0.5; |
| 45 |
} |
| 46 |
|
| 47 |
.bd-sidebar-primary { |
| 48 |
@include media-breakpoint-down($breakpoint-sidebar-primary) { |
| 49 |
@include sliding-drawer("left"); |
| 50 |
} |
| 51 |
|
| 52 |
&[open] { |
| 53 |
margin-left: 0; |
| 54 |
visibility: visible; |
| 55 |
} |
| 56 |
} |
| 57 |
|
| 58 |
.bd-sidebar-secondary { |
| 59 |
@include media-breakpoint-down($breakpoint-sidebar-secondary) { |
| 60 |
@include sliding-drawer("right"); |
| 61 |
} |
| 62 |
|
| 63 |
&[open] { |
| 64 |
margin-right: 0; |
| 65 |
visibility: visible; |
| 66 |
} |
| 67 |
} |