summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSorin Davidoi <sorin.davidoi@gmail.com>2018-02-15 00:24:39 +0100
committerMichael Bryan <michaelfbryan@gmail.com>2018-02-15 07:24:39 +0800
commit89a5dbaf9add5d5a5f6ecf41ff03cbf4f3ea3000 (patch)
tree0906c992acf7a04122558f244c027f0117971a08
parent6961247f56440ed254faa5726d771365dcb3257b (diff)
fix(theme/stylus/sidebar): Contain scrolling to the sidebar (#612)
> A position fixed left navigation bar does not want to hand off scrolling to the document because a scroll gesture performed on the navigation bar is almost never meant to scroll the document. In this case, the author can use contain on the sidebar to prevent scrolling from being chained to the parent document element. https://wicg.github.io/overscroll-behavior/#motivating-examples
-rw-r--r--src/theme/book.css1
-rw-r--r--src/theme/stylus/sidebar.styl1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/theme/book.css b/src/theme/book.css
index 28e9278f..dd9d8e7f 100644
--- a/src/theme/book.css
+++ b/src/theme/book.css
@@ -71,6 +71,7 @@ table thead td {
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-overflow-scrolling: touch;
+ overscroll-behavior-y: contain;
-webkit-transition: -webkit-transform 0.5s;
-moz-transition: -moz-transform 0.5s;
-o-transition: -o-transform 0.5s;
diff --git a/src/theme/stylus/sidebar.styl b/src/theme/stylus/sidebar.styl
index 7dd39c0a..7faba9d9 100644
--- a/src/theme/stylus/sidebar.styl
+++ b/src/theme/stylus/sidebar.styl
@@ -11,6 +11,7 @@
font-size: 0.875em
box-sizing: border-box
-webkit-overflow-scrolling: touch
+ overscroll-behavior-y: contain;
// Animation: slide away
transition: transform 0.5s