Responsive Sidebarmenu
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
justify-content: space-around;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.LP-Menu__Item {
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
|
@@ -7,6 +7,7 @@ $-logo-height: 45px;
|
||||
height: 60px;
|
||||
box-shadow: 0 0 2px $-light-brown;
|
||||
grid-area: header;
|
||||
background-color: white;
|
||||
|
||||
&__Navigation{
|
||||
flex-grow: 2;
|
||||
@@ -58,4 +59,13 @@ $-logo-height: 45px;
|
||||
.LP-Header__Navigation{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: $-viewport-toggle-sidebar){
|
||||
.LP-Header{
|
||||
padding-left: 40px;
|
||||
width: calc(100% - 40px);
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
}
|
||||
}
|
@@ -1,9 +1,11 @@
|
||||
<div class="LP-Wrapper__Site">
|
||||
{{> @header}}
|
||||
<input id="toggle_sidebar" class="LP-Menu__Trigger" type="checkbox"/>
|
||||
<label id="toggle_sidebar_label" for="toggle_sidebar" class="LP-Menu__TriggerLabel"></label>
|
||||
<aside class="LP-Main__Sidebar">
|
||||
{{> @navigation modifier='--sidebar'}}
|
||||
{{> @navigation modifier='--sidebar'}}
|
||||
</aside>
|
||||
<main class="LP-Main__Content">
|
||||
{{> @placedetail}}
|
||||
{{> @placedetail}}
|
||||
</main>
|
||||
</div>
|
@@ -31,6 +31,8 @@ $-viewport-extra-small: 450px;
|
||||
$-viewport-medium: 750px;
|
||||
$-viewport-normal: 1000px;
|
||||
|
||||
$-viewport-toggle-sidebar: $-viewport-small;
|
||||
|
||||
$-sidebar-width: 250px;
|
||||
|
||||
html{
|
||||
@@ -75,6 +77,11 @@ body{
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: $-viewport-normal){
|
||||
.LP-Wrapper__Site{
|
||||
grid-template-columns: (0.75 * $-sidebar-width) 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: $-viewport-small){
|
||||
.LP-Section{
|
||||
@@ -86,6 +93,69 @@ body{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: $-viewport-toggle-sidebar){
|
||||
.LP-Wrapper__Site{
|
||||
grid-template-columns: 0 1fr;
|
||||
}
|
||||
|
||||
@keyframes slide_out_siedebar{
|
||||
from{left: -1 * $-sidebar-width;}
|
||||
to{left: 0;}
|
||||
}
|
||||
|
||||
@keyframes slide_in_siedebar{
|
||||
from{left: 0;}
|
||||
to{left: -1 * $-sidebar-width;}
|
||||
}
|
||||
|
||||
.LP-Main__Sidebar{
|
||||
grid-area:unset;
|
||||
width: $-sidebar-width;
|
||||
z-index: 15;
|
||||
position: fixed;
|
||||
left: -1 * $-sidebar-width - 1;
|
||||
height: 100vh;
|
||||
top: 60px;
|
||||
border-right: 1px solid $-light-brown;
|
||||
}
|
||||
|
||||
#toggle_sidebar:checked ~ .LP-Main__Sidebar{
|
||||
animation-name: slide_out_siedebar;
|
||||
animation-duration: .3s;
|
||||
left: 0 ;
|
||||
}
|
||||
|
||||
#toggle_sidebar ~ .LP-Main__Sidebar{
|
||||
animation-name: slide_in_siedebar;
|
||||
animation-duration: .3s;
|
||||
}
|
||||
|
||||
.LP-Menu__Trigger{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.LP-Menu__TriggerLabel{
|
||||
z-index: 20;
|
||||
height: 60px;
|
||||
width: 60px;
|
||||
background-image: url('/icons/hamburger_menu.svg');
|
||||
background-repeat: no-repeat;
|
||||
background-clip: content-box;
|
||||
background-position: center;
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
.LP-Menu__Trigger:checked ~ .LP-Menu__TriggerLabel{
|
||||
background-color: invert($-grey);
|
||||
filter: invert(1);
|
||||
}
|
||||
|
||||
.LP-Main__Content{
|
||||
margin-top: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
@import '01_Atoms/atoms';
|
||||
@import '02_Molecules/molecules';
|
||||
@import '03_Organisms/organisms';
|
||||
|
Reference in New Issue
Block a user