Avoid resizing page/content on sidebar toggle
This commit is contained in:
parent
65acb355d7
commit
6e90e520d6
|
@ -6,6 +6,7 @@ body {
|
|||
body {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
code {
|
||||
font-family: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace;
|
||||
|
@ -109,28 +110,25 @@ table thead td {
|
|||
white-space: nowrap;
|
||||
}
|
||||
.page-wrapper {
|
||||
padding-left: 300px;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
min-height: 100%;
|
||||
-webkit-transition: padding-left 0.5s, margin-right 0.5s;
|
||||
-moz-transition: padding-left 0.5s, margin-right 0.5s;
|
||||
-o-transition: padding-left 0.5s, margin-right 0.5s;
|
||||
-ms-transition: padding-left 0.5s, margin-right 0.5s;
|
||||
transition: padding-left 0.5s, margin-right 0.5s;
|
||||
}
|
||||
@media only screen and (max-width: 1060px) {
|
||||
.page-wrapper {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
.sidebar-hidden .page-wrapper {
|
||||
padding-left: 0;
|
||||
width: 100%;
|
||||
-webkit-transition: padding-left 0.5s, margin-left 0.5s;
|
||||
-moz-transition: padding-left 0.5s, margin-left 0.5s;
|
||||
-o-transition: padding-left 0.5s, margin-left 0.5s;
|
||||
-ms-transition: padding-left 0.5s, margin-left 0.5s;
|
||||
transition: padding-left 0.5s, margin-left 0.5s;
|
||||
}
|
||||
.sidebar-visible .page-wrapper {
|
||||
padding-left: 300px;
|
||||
margin-right: -300px;
|
||||
}
|
||||
@media only screen and (max-width: 1079px) {
|
||||
.sidebar-visible .page-wrapper {
|
||||
padding-left: 0;
|
||||
margin-left: 300px;
|
||||
}
|
||||
}
|
||||
.page {
|
||||
outline: 0;
|
||||
|
|
|
@ -6,6 +6,7 @@ html, body {
|
|||
body {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
overflow-x: hidden
|
||||
}
|
||||
|
||||
code {
|
||||
|
|
|
@ -1,26 +1,24 @@
|
|||
@require 'variables'
|
||||
|
||||
.page-wrapper {
|
||||
padding-left: $sidebar-width
|
||||
box-sizing: border-box
|
||||
|
||||
min-height: 100%
|
||||
width: 100%
|
||||
|
||||
// Animation: slide away
|
||||
transition: padding-left 0.5s, margin-right 0.5s
|
||||
|
||||
@media only screen and (max-width: $max-page-width-with-hidden-sidebar) {
|
||||
padding-left: 0
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-hidden .page-wrapper {
|
||||
padding-left: 0
|
||||
transition: padding-left 0.5s, margin-left 0.5s
|
||||
}
|
||||
|
||||
.sidebar-visible .page-wrapper {
|
||||
padding-left: $sidebar-width
|
||||
margin-right: - $sidebar-width
|
||||
}
|
||||
|
||||
@media only screen and (max-width: $page-plus-sidebar-width - 1) {
|
||||
.sidebar-visible .page-wrapper {
|
||||
padding-left: 0
|
||||
margin-left: $sidebar-width
|
||||
}
|
||||
}
|
||||
|
||||
.page {
|
||||
|
@ -30,7 +28,7 @@
|
|||
|
||||
.content {
|
||||
margin-left: auto
|
||||
margin-right:auto
|
||||
margin-right: auto
|
||||
max-width: $content-max-width
|
||||
padding-bottom: 50px
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
$sidebar-width = 300px
|
||||
$page-padding = 15px
|
||||
$max-page-width-with-hidden-sidebar = 1060px
|
||||
$content-max-width = 750px
|
||||
$max-page-width-with-hidden-sidebar = 1060px
|
||||
$page-plus-sidebar-width = $content-max-width + $sidebar-width + $page-padding * 2
|
||||
|
|
Loading…
Reference in New Issue