mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-10 05:06:15 -05:00
Fix scrollbar shifting layout
This commit is contained in:
10
app/root.tsx
10
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, {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user