Merge branch 'master' of github.com:azerupi/mdBook

This commit is contained in:
Mathieu David 2017-06-23 01:10:38 +02:00
commit 3306c030e1
6 changed files with 65 additions and 52 deletions

View File

@ -3,6 +3,9 @@ body {
font-family: "Open Sans", sans-serif; font-family: "Open Sans", sans-serif;
color: #333; color: #333;
} }
body {
margin: 0;
}
code { code {
font-family: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace; font-family: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace;
font-size: 0.875em; font-size: 0.875em;
@ -41,7 +44,7 @@ table thead td {
font-weight: 700; font-weight: 700;
} }
.sidebar { .sidebar {
position: absolute; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
@ -102,44 +105,31 @@ table thead td {
white-space: nowrap; white-space: nowrap;
} }
.page-wrapper { .page-wrapper {
position: absolute; padding-left: 300px;
overflow-y: auto;
left: 315px;
right: 0;
top: 0;
bottom: 0;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
-webkit-overflow-scrolling: touch;
min-height: 100%; min-height: 100%;
-webkit-transition: left 0.5s; -webkit-transition: padding-left 0.5s;
-moz-transition: left 0.5s; -moz-transition: padding-left 0.5s;
-o-transition: left 0.5s; -o-transition: padding-left 0.5s;
-ms-transition: left 0.5s; -ms-transition: padding-left 0.5s;
transition: left 0.5s; transition: padding-left 0.5s;
} }
@media only screen and (max-width: 1060px) { @media only screen and (max-width: 1060px) {
.page-wrapper { .page-wrapper {
left: 15px; padding-left: 0;
padding-right: 15px;
} }
} }
.sidebar-hidden .page-wrapper { .sidebar-hidden .page-wrapper {
left: 15px; padding-left: 0;
} }
.sidebar-visible .page-wrapper { .sidebar-visible .page-wrapper {
left: 315px; padding-left: 300px;
} }
.page { .page {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
outline: 0; outline: 0;
padding-right: 15px; padding: 0 15px;
overflow-y: auto;
} }
.content { .content {
margin-left: auto; margin-left: auto;
@ -210,7 +200,7 @@ table thead td {
font-size: 2.5em; font-size: 2.5em;
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
position: absolute; position: fixed;
top: 50px /* Height of menu-bar */; top: 50px /* Height of menu-bar */;
bottom: 0; bottom: 0;
margin: 0; margin: 0;
@ -250,11 +240,27 @@ table thead td {
text-decoration: none; text-decoration: none;
} }
.previous { .previous {
left: 0; left: 315px;
-webkit-transition: left 0.5s;
-moz-transition: left 0.5s;
-o-transition: left 0.5s;
-ms-transition: left 0.5s;
transition: left 0.5s;
}
@media only screen and (max-width: 1060px) {
.previous {
left: 15px;
}
} }
.next { .next {
right: 15px; right: 15px;
} }
.sidebar-hidden .previous {
left: 15px;
}
.sidebar-visible .previous {
left: 315px;
}
.theme-popup { .theme-popup {
position: relative; position: relative;
left: 10px; left: 10px;

View File

@ -3,6 +3,10 @@ html, body {
color: #333 color: #333
} }
body {
margin: 0;
}
code { code {
font-family: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace; font-family: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace;
font-size: 0.875em; font-size: 0.875em;

View File

@ -3,7 +3,7 @@
text-align: center text-align: center
text-decoration: none text-decoration: none
position: absolute position: fixed
top: 50px /* Height of menu-bar */ top: 50px /* Height of menu-bar */
bottom: 0 bottom: 0
margin: 0 margin: 0
@ -19,5 +19,20 @@
.mobile-nav-chapters { display: none } .mobile-nav-chapters { display: none }
.nav-chapters:hover { text-decoration: none } .nav-chapters:hover { text-decoration: none }
.previous { left: 0 } .previous {
.next { right: 15px } left: $sidebar-width + $page-padding
transition: left 0.5s
@media only screen and (max-width: $max-page-width-with-hidden-sidebar) {
left: $page-padding
}
}
.next { right: $page-padding }
.sidebar-hidden .previous {
left: $page-padding
}
.sidebar-visible .previous {
left: $sidebar-width + $page-padding
}

View File

@ -1,44 +1,30 @@
@require 'variables' @require 'variables'
.page-wrapper { .page-wrapper {
position: absolute padding-left: $sidebar-width
overflow-y: auto
left: $sidebar-width + 15px
right: 0
top: 0
bottom: 0
box-sizing: border-box box-sizing: border-box
-webkit-overflow-scrolling: touch
min-height: 100% min-height: 100%
// Animation: slide away // Animation: slide away
transition: left 0.5s transition: padding-left 0.5s
@media only screen and (max-width: 1060px) { @media only screen and (max-width: $max-page-width-with-hidden-sidebar) {
left: 15px; padding-left: 0
padding-right: 15px;
} }
} }
.sidebar-hidden .page-wrapper { .sidebar-hidden .page-wrapper {
left: 15px padding-left: 0
} }
.sidebar-visible .page-wrapper { .sidebar-visible .page-wrapper {
left: $sidebar-width + 15px padding-left: $sidebar-width
} }
.page { .page {
position: absolute
top: 0
right: 0
left: 0
bottom: 0
outline: 0 outline: 0
padding: 0 $page-padding
padding-right: 15px
overflow-y: auto
} }
.content { .content {

View File

@ -1,7 +1,7 @@
@require 'variables' @require 'variables'
.sidebar { .sidebar {
position: absolute position: fixed
left: 0 left: 0
top: 0 top: 0
bottom: 0 bottom: 0
@ -15,7 +15,7 @@
// Animation: slide away // Animation: slide away
transition: left 0.5s transition: left 0.5s
@media only screen and (max-width: 1060px) { @media only screen and (max-width: $max-page-width-with-hidden-sidebar) {
left: - $sidebar-width left: - $sidebar-width
} }

View File

@ -1 +1,3 @@
$sidebar-width = 300px $sidebar-width = 300px
$page-padding = 15px
$max-page-width-with-hidden-sidebar = 1060px