Side Drawer Component
A CSS implementation of the Sprout side drawer component.
Related
Sprout Side Drawer documentation [external]
Example
html
<div style="height: 400px;">
<div class="spr-panel"> This is the main content! </div>
<div class="spr-side-drawer-overlay-container spr-side-drawer-overlay-dark-background">
<div class="spr-side-drawer-wrapper">
<div class="spr-side-drawer spr-side-drawer-open">
<div class="spr-side-drawer-header">
<div><i class="spr-icon spr-icon-close"></i></div>
</div>
This is the side drawer contents!
</div>
<div>
</div>
</div>
Compiled CSS
Example
scss
@import 'components/side-drawer';
css
compiled
@keyframes openPopover {
from {
transform: scale(0.9);
}
to {
transform: scale(1);
}
}
.spr-side-drawer-wrapper,
.spr-side-drawer-wrapper .spr-side-drawer {
display: inline-block;
}
.spr-side-drawer-wrapper {
color: #f7f7f8;
white-space: nowrap;
position: absolute;
top: 0;
right: 0;
display: flex;
justify-content: flex-end;
height: 100vh;
width: 16rem;
}
.spr-side-drawer-wrapper .spr-icon {
/* override the color and of the icons
that are children of the sidenav */
background-color: #f7f7f8 !important;
}
.spr-side-drawer-wrapper .spr-side-drawer {
background-color: #18191b;
display: flex;
flex-direction: column;
width: 0%;
overflow: hidden;
transition-property: width;
transition-duration: 0.41s;
transition-timing-function: ease-in-out;
}
.spr-side-drawer-open {
width: 100% !important;
}
.spr-side-drawer-overlay-container {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.spr-side-drawer-overlay-dark-background {
background-color: rgba(24, 25, 27, 0.5) !important;
}
.spr-side-drawer-header {
padding: 1rem 1rem;
display: flex;
justify-content: flex-end;
flex-direction: row;
flex: 0;
}
.spr-side-drawer-header .spr-icon-close {
cursor: pointer;
}