From 1d3f71bcc490b66492f3ca021536e82799ab9a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Tue, 21 Feb 2023 00:03:39 +0100 Subject: [PATCH] css: Add scrollbar-gutter property to prevent shifted content Some pages require a scroll bar, some do not. If the scroll bar is hidden on a page that do not require it (default behavior of most browsers), centered content is shifted to the right slightly. Fix this behavior by using the scrollbar-gutter property, so the renderer automatically reserves space for the scrollbar. --- assets/_custom.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/_custom.scss b/assets/_custom.scss index 067f94c..aebffa1 100644 --- a/assets/_custom.scss +++ b/assets/_custom.scss @@ -1,3 +1,7 @@ +html { + scrollbar-gutter: stable; +} + .book-page { box-shadow: 0 0 1.5rem rgba(0, 0, 0, 0.15); min-height: 100vh;