From 31fb4435625e543d373cc71ae57b6ef05f15fa21 Mon Sep 17 00:00:00 2001 From: Shane Nelson Date: Mon, 18 Dec 2017 00:14:25 -0500 Subject: [PATCH] Cleanup and various fixes --- src/theme/book.css | 72 +++++++++++-------------------- src/theme/index.hbs | 40 ++++++++--------- src/theme/stylus/nav-icons.styl | 48 ++++++++++++++------- src/theme/stylus/theme-popup.styl | 35 +-------------- src/theme/stylus/variables.styl | 1 - 5 files changed, 75 insertions(+), 121 deletions(-) diff --git a/src/theme/book.css b/src/theme/book.css index 32cbbf1b..7e83864b 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -228,32 +228,41 @@ table thead td { -ms-transition: color 0.5s; transition: color 0.5s; } -.mobile-nav-chapters { - display: none; -} .nav-chapters:hover { text-decoration: none; } +.nav-wrapper { + margin-top: 50px; + display: none; +} +.mobile-nav-chapters { + font-size: 2.5em; + text-align: center; + text-decoration: none; + width: 90px; + border-radius: 5px; +} .previous { - left: 15px; - -webkit-transition: left 0.5s; - -moz-transition: left 0.5s; - -o-transition: left 0.5s; - -ms-transition: left 0.5s; - transition: left 0.5s; + float: left; } .next { + float: right; right: 15px; } -@media only screen and (min-width: 1251px) { - .sidebar-visible .previous { - left: 315px; +@media only screen and (max-width: 1080px) { + .nav-chapters { + display: none; + } + .nav-wrapper { + display: block; } } -@media only screen and (max-width: 1060px) { - .nav-wrapper { - max-width: 750px; - margin: 0 auto; +@media only screen and (max-width: 1380px) { + .sidebar-visible .nav-chapters { + display: none; + } + .sidebar-visible .nav-wrapper { + display: block; } } .theme-popup { @@ -275,37 +284,6 @@ table thead td { border-top-left-radius: inherit; border-top-right-radius: inherit; } -@media only screen and (max-width: 1060px) { - .nav-chapters { - display: none; - } - .mobile-nav-chapters { - font-size: 2.5em; - text-align: center; - text-decoration: none; - max-width: 150px; - min-width: 90px; - -webkit-box-pack: center; - -moz-box-pack: center; - -o-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -ms-flex-line-pack: center; - -webkit-align-content: center; - align-content: center; - position: relative; - display: inline-block; - margin-bottom: 50px; - border-radius: 5px; - } - .next { - float: right; - } - .previous { - float: left; - } -} .light { color: #333; background-color: #fff; diff --git a/src/theme/index.hbs b/src/theme/index.hbs index 9df89a7e..3a6a596f 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -93,30 +93,24 @@
{{{ content }}} + +
- - - - {{#previous}} diff --git a/src/theme/stylus/nav-icons.styl b/src/theme/stylus/nav-icons.styl index 222cf444..d756a8f8 100644 --- a/src/theme/stylus/nav-icons.styl +++ b/src/theme/stylus/nav-icons.styl @@ -9,6 +9,7 @@ margin: 0 max-width: 150px min-width: 90px + display: flex justify-content: center align-content: center @@ -17,23 +18,38 @@ transition: color 0.5s } -.mobile-nav-chapters { display: none } .nav-chapters:hover { text-decoration: none } -.previous { - left: $page-padding - transition: left 0.5s -} -.next { right: $page-padding } - -@media only screen and (min-width: 1251px) { - .sidebar-visible .previous { - left: $sidebar-width + $page-padding - } -} .nav-wrapper { - @media only screen and (max-width: $max-page-width-with-hidden-sidebar) { - max-width: $content-max-width - margin: 0 auto - } + margin-top: 50px + display: none +} + +.mobile-nav-chapters { + font-size: 2.5em + text-align: center + text-decoration: none + width: 90px + border-radius: 5px +} + +.previous { + float: left +} + +.next { + float: right + right: $page-padding +} + +@media only screen and (max-width: $page-plus-sidebar-width) { + .nav-chapters { display: none } + .nav-wrapper { display: block } +} + +@media only screen and (max-width: $page-plus-sidebar-width + $sidebar-width) { + .sidebar-visible { + .nav-chapters { display: none } + .nav-wrapper { display: block } + } } diff --git a/src/theme/stylus/theme-popup.styl b/src/theme/stylus/theme-popup.styl index 2a0a87b0..fc51bc35 100644 --- a/src/theme/stylus/theme-popup.styl +++ b/src/theme/stylus/theme-popup.styl @@ -21,37 +21,4 @@ } } -} - -@media only screen and (max-width: $max-page-width-with-hidden-sidebar) { - - .nav-chapters { - display: none - } - - .mobile-nav-chapters { - font-size: 2.5em - text-align: center - text-decoration: none - - max-width: 150px - min-width: 90px - - justify-content: center - align-content: center - - position: relative - display: inline-block - margin-bottom: 50px - - border-radius: 5px - } - - .next { - float: right - } - - .previous { - float: left - } -} +} \ No newline at end of file diff --git a/src/theme/stylus/variables.styl b/src/theme/stylus/variables.styl index c02af07b..3d2c95b2 100644 --- a/src/theme/stylus/variables.styl +++ b/src/theme/stylus/variables.styl @@ -1,5 +1,4 @@ $sidebar-width = 300px $page-padding = 15px $content-max-width = 750px -$max-page-width-with-hidden-sidebar = 1060px $page-plus-sidebar-width = $content-max-width + $sidebar-width + $page-padding * 2