From 3b136689ee6c44134dc970616bf878384c4bd9b3 Mon Sep 17 00:00:00 2001 From: lifta42 Date: Sat, 2 Dec 2017 14:25:24 +0800 Subject: [PATCH 1/2] Fix a CSS bug to show arrow properly The arrow for "previous chapter" was on the incorrect position when screen width is between 1060px and 1250px. --- src/theme/book.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme/book.css b/src/theme/book.css index f0967be1..65397a68 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -251,7 +251,7 @@ table thead td { -ms-transition: left 0.5s; transition: left 0.5s; } -@media only screen and (max-width: 1060px) { +@media only screen and (max-width: 1250px) { .previous { left: 15px; } From 9143110a439efa0071d08b2ea1c45d45ba5dffc4 Mon Sep 17 00:00:00 2001 From: lifta42 Date: Wed, 6 Dec 2017 16:20:22 +0800 Subject: [PATCH 2/2] Optimized the stylesheet for better performance --- src/theme/book.css | 21 +++++++++++++------- src/theme/index.hbs | 33 ++++++++++++++++++++----------- src/theme/stylus/nav-icons.styl | 7 +++++++ src/theme/stylus/page.styl | 5 +++-- src/theme/stylus/theme-popup.styl | 2 +- src/theme/stylus/variables.styl | 1 + 6 files changed, 47 insertions(+), 22 deletions(-) diff --git a/src/theme/book.css b/src/theme/book.css index 65397a68..4699400d 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -114,11 +114,11 @@ table thead td { -moz-box-sizing: border-box; box-sizing: border-box; min-height: 100%; - -webkit-transition: padding-left 0.5s; - -moz-transition: padding-left 0.5s; - -o-transition: padding-left 0.5s; - -ms-transition: padding-left 0.5s; - transition: padding-left 0.5s; + -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 { @@ -130,6 +130,7 @@ table thead td { } .sidebar-visible .page-wrapper { padding-left: 300px; + margin-right: -300px; } .page { outline: 0; @@ -251,7 +252,7 @@ table thead td { -ms-transition: left 0.5s; transition: left 0.5s; } -@media only screen and (max-width: 1250px) { +@media only screen and (max-width: 1060px) { .previous { left: 15px; } @@ -265,6 +266,12 @@ table thead td { .sidebar-visible .previous { left: 315px; } +@media only screen and (max-width: 1060px) { + .nav-wrapper { + max-width: 750px; + margin: 0 auto; + } +} .theme-popup { position: absolute; left: 10px; @@ -284,7 +291,7 @@ table thead td { border-top-left-radius: inherit; border-top-right-radius: inherit; } -@media only screen and (max-width: 1250px) { +@media only screen and (max-width: 1060px) { .nav-chapters { display: none; } diff --git a/src/theme/index.hbs b/src/theme/index.hbs index 2a6c34ee..bc5855f4 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -94,18 +94,27 @@ {{{ content }}} - - {{#previous}} - - {{/previous}} + + @@ -139,7 +148,7 @@