Fix scrollbar shifting layout

This commit is contained in:
hfcRed
2026-03-20 04:22:19 +01:00
parent 9acbac59f0
commit eecab39cd3
2 changed files with 8 additions and 3 deletions

View File

@@ -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, {

View File

@@ -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);
}