From eecab39cd3a99a091329b730c68a43cdd922ba85 Mon Sep 17 00:00:00 2001 From: hfcRed Date: Fri, 20 Mar 2026 04:22:19 +0100 Subject: [PATCH] Fix scrollbar shifting layout --- app/root.tsx | 10 ++++++++-- app/styles/common.css | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/root.tsx b/app/root.tsx index 1501cda57..62c9717f3 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -363,12 +363,18 @@ export default function App() { observer.disconnect(); if (htmlStyle.overflow === "hidden") { + htmlStyle.overflow = ""; + htmlStyle.scrollbarGutter = ""; + + const scrollbarWidth = + window.innerWidth - document.documentElement.clientWidth; + htmlStyle.overflow = "initial"; bodyStyle.overflow = "hidden"; - bodyStyle.scrollbarGutter = "stable"; + bodyStyle.paddingRight = `${scrollbarWidth}px`; } else if (bodyStyle.overflow === "hidden") { bodyStyle.overflow = ""; - bodyStyle.scrollbarGutter = ""; + bodyStyle.paddingRight = ""; } observer.observe(document.documentElement, { diff --git a/app/styles/common.css b/app/styles/common.css index 95d1149ce..1fa95c30f 100644 --- a/app/styles/common.css +++ b/app/styles/common.css @@ -8,7 +8,6 @@ html { color-scheme: light dark; accent-color: var(--color-text-accent); - scrollbar-gutter: stable; scroll-padding-top: var(--layout-sticky-top); }