From 89a5dbaf9add5d5a5f6ecf41ff03cbf4f3ea3000 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Thu, 15 Feb 2018 00:24:39 +0100 Subject: [PATCH] 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 --- src/theme/book.css | 1 + src/theme/stylus/sidebar.styl | 1 + 2 files changed, 2 insertions(+) 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