From 49eae1aba3e74c08e2fad8bdb6a52415731cf9de Mon Sep 17 00:00:00 2001 From: Vinta Chen Date: Sun, 22 Mar 2026 02:19:40 +0800 Subject: [PATCH] fix(website): center back-to-top button using left/margin instead of right Previously used right: max(1.5rem, calc(50vw - 700px + 0.5rem)) which caused the button to overlap content at certain viewport widths. Switch to left: 50% with margin-left: -2rem to keep it centered relative to the viewport without interfering with sidebar or content layout. Co-Authored-By: Claude --- website/static/style.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/website/static/style.css b/website/static/style.css index 304c8650..062263d8 100644 --- a/website/static/style.css +++ b/website/static/style.css @@ -531,7 +531,8 @@ th[data-sort].sort-asc::after { .back-to-top { position: fixed; bottom: 2rem; - right: max(1.5rem, calc(50vw - 700px + 0.5rem)); + left: 50%; + margin-left: -2rem; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 4px; @@ -569,7 +570,7 @@ th[data-sort].sort-asc::after { } @media (max-width: 640px) { - .back-to-top { right: 1.25rem; bottom: 1.25rem; } + .back-to-top { bottom: 1.25rem; } } /* === Noscript === */