From 64d9eb2474fb84ef2b6d141dbef0532bcbc4541a Mon Sep 17 00:00:00 2001 From: kbot Date: Wed, 3 Jun 2026 21:52:53 -0500 Subject: [PATCH] refactor: replace hardcoded scroll offset pixels with CSS custom property --- app/globals.css | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/globals.css b/app/globals.css index 628cbd7..50059c7 100644 --- a/app/globals.css +++ b/app/globals.css @@ -3,6 +3,10 @@ /* Dark mode: class-based (for @wrksz/themes) */ @custom-variant dark (&:is(.dark)); +:root { + --scroll-offset: 7.5rem; /* ~120px, generous offset for sticky header */ +} + /* === Design Tokens === */ @theme { /* Colors — Light mode defaults */ @@ -71,10 +75,9 @@ @layer base { html { - scroll-padding-top: 96px; + scroll-padding-top: var(--scroll-offset); } body { - --header-height: 56px; font-family: var(--font-serif); font-weight: 400; line-height: 1.6; @@ -185,7 +188,7 @@ .prose :where(h1, h2, h3, h4, h5, h6) { color: var(--color-ink); - scroll-margin-top: 96px; + scroll-margin-top: var(--scroll-offset); } .prose :where(h1) { margin: 2.75rem 0 1rem; }