From cfae09a7d302da1e0ebbe0209b46eca89e74e093 Mon Sep 17 00:00:00 2001 From: TerryM Date: Fri, 29 May 2026 13:30:44 +0800 Subject: [PATCH] fix: make window the vertical scroller so back-to-top works MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit body had height:100% + overflow-x:hidden, which forces computed overflow-y to `auto` — turning body into its own scroll box at viewport height. window.scrollY then never moved, so the back-to-top button never appeared and window.scrollTo was a no-op. Apply overflow-x:hidden to only; it propagates to the viewport (still clipping horizontal overflow) while leaving the window as the vertical scroller. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/index.css | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/index.css b/src/index.css index c1ffb61..d052de6 100644 --- a/src/index.css +++ b/src/index.css @@ -8,8 +8,12 @@ body, height: 100%; } -html, -body { +/* Only clip horizontal overflow on ; this propagates to the viewport + and keeps the window as the vertical scroller. Adding overflow-x to + (which has height:100%) would force its computed overflow-y to `auto`, + turning body into its own scroll box so window.scrollY never moves — which + breaks scroll-position features like the back-to-top button. */ +html { overflow-x: hidden; }