From 78a3c971ff0e508b1fc367d25bcf3915c0bf319d Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Sat, 26 Sep 2020 21:48:22 +0300 Subject: [PATCH] Fix unstyled scrollbar --- src/assets/css/site.css | 9 ++++----- src/scripts/autoThemes.js | 6 +++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/assets/css/site.css b/src/assets/css/site.css index 9eb61de074..38e056df89 100644 --- a/src/assets/css/site.css +++ b/src/assets/css/site.css @@ -44,11 +44,6 @@ body { overflow-x: hidden; background-color: transparent !important; -webkit-font-smoothing: antialiased; - - /* This keeps the scrollbar always present in all pages, so we avoid clipping while switching between pages - that need the scrollbar and pages that don't. - */ - overflow-y: scroll; } .mainAnimatedPage { @@ -127,6 +122,10 @@ div[data-role=page] { padding-bottom: 4em; } +.force-scroll { + overflow-y: scroll; +} + .hide-scroll { overflow-y: hidden; } diff --git a/src/scripts/autoThemes.js b/src/scripts/autoThemes.js index e278a80dc9..daf8ae581b 100644 --- a/src/scripts/autoThemes.js +++ b/src/scripts/autoThemes.js @@ -3,7 +3,11 @@ import skinManager from 'skinManager'; import events from 'events'; // Set the default theme when loading -skinManager.setTheme(userSettings.theme()); +skinManager.setTheme(userSettings.theme()) + /* This keeps the scrollbar always present in all pages, so we avoid clipping while switching between pages + that need the scrollbar and pages that don't. + */ + .then(() => document.body.classList.add('force-scroll')); // Set the user's prefered theme when signing in events.on(window.connectionManager, 'localusersignedin', function (e, user) {