Files
30-seconds-of-code/src/css/components/sidebar.scss
2018-03-03 15:05:35 +10:00

117 lines
2.2 KiB
SCSS

.sidebar {
background: #202e4e;
position: fixed;
z-index: 2;
width: 100%;
height: 44px;
box-shadow: 0 0.25rem 0.5rem -0.1rem rgba(0, 32, 128, 0.2);
&__menu {
position: absolute;
font-weight: bold;
border: none;
text-align: left;
text-transform: uppercase;
left: 0;
top: 0;
padding: 0.75rem 1rem;
outline: 0;
}
&__menu-icon {
height: 24px;
}
&__links {
background: #202e4e;
overflow-y: auto;
transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
transform-origin: 0% 0%;
transform: rotateX(-90deg);
visibility: hidden;
opacity: 0;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
max-height: 378px;
margin-top: 44px;
box-shadow: 0 0.25rem 0.5rem -0.1rem rgba(0, 32, 128, 0.2);
padding-bottom: 1rem;
&.is-active {
transform: rotateX(0);
visibility: visible;
opacity: 1;
}
}
&__link {
display: block;
color: #e3f5ff;
padding: 0.5rem 0.75rem;
transition: all 0.1s ease-out;
border-left: 2px solid #576a85;
margin: 0.5rem;
font-weight: 500;
font-size: 0.95rem;
&:hover {
color: #88f4ff;
background: rgba(255, 255, 255, 0.1);
border-color: pink;
}
}
&__section {
padding: 0 0.75rem;
}
&__section-heading {
text-transform: capitalize;
color: #e3f5ff;
margin-bottom: 0.5rem;
}
}
@media (min-width: 992px) {
.sidebar {
left: 0;
top: 0;
bottom: 0;
width: 15%;
max-width: 250px;
min-width: 200px;
height: 100%;
background: linear-gradient(-30deg, #2a3d67, #14264e);
box-shadow: 0.4rem 0.4rem 0.8rem rgba(0, 32, 64, 0.1);
overflow-y: auto;
color: white;
&::-webkit-scrollbar-track {
background-color: rgba(0, 0, 0, 0.6);
}
&::-webkit-scrollbar {
width: 10px;
background-color: #4b6191;
}
&::-webkit-scrollbar-thumb {
background-color: #4b6191;
}
&__links {
background: none;
box-shadow: none;
visibility: visible;
opacity: 1;
transform: rotateX(0);
margin-top: 0;
max-height: none;
}
&__menu {
display: none;
}
}
}