Scale the index hero heading to 75% of its previous size and put the header, hero, sections, devices page and footer on one horizontal grid (--pad / --maxw). Enable smooth scrolling for anchor links when reduced motion is not requested.
2.2 KiB
2.2 KiB
Hero scale, shared horizontal grid, smooth back-to-top
Date: 2026-11-01
Request
- Index hero heading was too big → scale to 75% (confirmed with the user; "0.75%" was shorthand for 0.75×).
- Every section (header, hero, modules, footer, devices) must share the same left/right section padding and centering margins so content edges align on the same vertical lines.
- Footer "Back to top" (
#top) must scroll smoothly.
Changes
src/styles/global.css- Added shared layout tokens:
--pad:clamp(18px,4vw,52px)and--maxw:1100px. .hdr,.hero,.module,.ftnow all usevar(--pad);.hdr-in,.hero-wrap,.wrapall usemax-width:var(--maxw)..htitleis nowclamp(40.5px,9.75vw,138px)— exactly 75% of the oldclamp(54px,13vw,184px).@media (prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}}. The existing reduced-motion block still disables animation/transitions; smooth scrolling is opt-in only, so reduced-motion users jump instantly.
- Added shared layout tokens:
src/components/Header.astro- Header contents wrapped in
.hdr-inso the bar background stays full-bleed while the logo/nav align to the shared content column.
- Header contents wrapped in
src/pages/devices.astro.dv-wrapno longer overrides to 1080px + 24px padding; it now uses the shared--maxwwith no extra padding.
Verified (headless Chromium via CDP)
- At 1427, 1200, 1024, 800, 390 and 320px, on
/,/project/and/devices/: every.hdr-in,.hero-wrapand.wraphas an identical left and right edge (e.g. 163.5/1263.5 at 1427px, 18/302 at 320px). No horizontal overflow. .htitlecomputed138pxat 1427 (was 184px) and117pxat 1200 (was 156px);40.5pxat 320/390 (was 54px).- smooth scroll:
scrollBehavior: smooth; clicking the footer#toplink at the bottom (scrollY 3373) animates to 0 over ~900ms. npm run buildpasses (5 routes).- Header still fits at 320/390 (no content overflow).
Notes / interpretation
- Only section-level gutters and content columns were unified. Deliberate inner indents stay: the path spine's 84px content offset and the second "door" column's 44px inner padding.
- Verification scripts are in
/tmp/opencodeand are not committed.