From 07551760c924296f8a5f5c7118a790602ea4aa96 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Wed, 14 Feb 2018 23:59:55 +0100 Subject: [PATCH] feat(theme/stylus/sidebar): Reduce padding on non-touch devices (#615) Closes #594. --- src/theme/book.css | 14 ++++++++++++-- src/theme/stylus/sidebar.styl | 6 ++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/theme/book.css b/src/theme/book.css index 1efbfb85..28e9278f 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -94,16 +94,26 @@ table thead td { } .chapter li a { display: block; - padding: 5px 0; + padding: 0; text-decoration: none; } +@media (-moz-touch-enabled: 1), (pointer: coarse) { + .chapter li a { + padding: 5px 0; + } +} .chapter li a:hover { text-decoration: none; } .chapter .spacer { width: 100%; height: 3px; - margin: 10px 0px; + margin: 5px 0px; +} +@media (-moz-touch-enabled: 1), (pointer: coarse) { + .chapter .spacer { + margin: 10px 0; + } } .section { list-style: none outside none; diff --git a/src/theme/stylus/sidebar.styl b/src/theme/stylus/sidebar.styl index 2cacd0e2..7dd39c0a 100644 --- a/src/theme/stylus/sidebar.styl +++ b/src/theme/stylus/sidebar.styl @@ -31,16 +31,18 @@ li a { display: block; - padding: 5px 0 + padding: 0 text-decoration: none + @media (-moz-touch-enabled: 1), (pointer: coarse) { padding: 5px 0; } &:hover { text-decoration: none } } .spacer { width: 100% height: 3px - margin: 10px 0px + margin: 5px 0px + @media (-moz-touch-enabled: 1), (pointer: coarse) { margin: 10px 0; } } }