Files
HealthLog/src/lib/motion.ts
T
Marc-André Bombeck fea1d1e0b5 chore: strip planning tags from comments and enable the rule
Output of `node scripts/strip-planning-tags.mjs --write`: 3,157 comment
lines in 1,308 files lose the work-item identifier at their head. Release
versions and issue references stay; nothing outside comment text
changes, which the script checks per file against a comment-free
printout. healthlog/no-planning-tags is enabled at error level with this
commit, so the tree it lands on is clean.
2026-10-20 09:08:40 +02:00

14 lines
606 B
TypeScript

// v1.4.43 — single source of truth for `behavior` on the four
// programmatic `scrollIntoView` / `scrollTo` call-sites in the app.
// `prefers-reduced-motion: reduce` users were previously animated against
// their OS-level preference, which is a WCAG 2.3.3 violation. The helper
// returns `"auto"` whenever a window is unavailable (SSR) or when the
// reduced-motion media query matches.
export function scrollBehaviorForUser(): ScrollBehavior {
if (typeof window === "undefined") return "auto";
return window.matchMedia("(prefers-reduced-motion: reduce)").matches
? "auto"
: "smooth";
}