From 2dd23bd2c871da5b7942dfd740ee81763fe5c638 Mon Sep 17 00:00:00 2001 From: Niel Thiart Date: Tue, 24 Jan 2023 12:27:44 +0200 Subject: [PATCH] Hide sub-navigation on mobile to stop screen flickering while scrolling Ref: https://github.com/sourcegraph/handbook/issues/3666 The sidebar appears above the content on screen sizes below 900px wide. As we scroll down the page, sub-menus in the sidebar become active. This pushes content down which deactivates the sub-menu, causing a loop. --- src/styles/page.scss | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/styles/page.scss b/src/styles/page.scss index 6ef47eccf164..37caa4e320a8 100644 --- a/src/styles/page.scss +++ b/src/styles/page.scss @@ -66,8 +66,14 @@ > li > ul { padding-left: 0; - ul:not(.active) { + ul { display: none; + + @media (min-width: 900px) { + &.active { + display: block; + } + } } }