/** * Extended compatibility: OPT-IN module for old browsers. Call `compat()` * once, before anything else from scrollvars: * * import { compat } from 'scrollvars/compat' * compat() * * On a modern browser it runs three feature checks and returns false. No * stubs, no styles, effectively free. On an old one it patches the gaps: * * - ResizeObserver missing (Safari < 13.1): a window-resize-backed stub: * re-measures on viewport changes (misses pure content growth; the page * still works, call `refresh()` after big DOM swaps if needed). Its * `contentRect` is measured from the layout box, like the native * observer, so an ancestor `transform: scale()` never inflates it. * - IntersectionObserver missing (Safari < 12.1): an always-visible stub: * the canvas harness simply never auto-pauses offscreen. * - Individual transform properties missing (`translate:`, Chrome < 104, * Firefox < 72, Safari < 14.1): injects a fallback stylesheet that * re-expresses with `transform:` the same presets README lists: * sv-rise, sv-fade, sv-slide-l, sv-slide-r, sv-auto (its auto-ordered * children), sv-drift, sv-curtain-l, sv-curtain-r, sv-rail. * Written without :is(), clamp() or min() so the old parser accepts * it; the one max() left, drift's fade, sits behind a plain opacity * declaration that parser keeps. Two presets stay static, one * reason each: * sv-deck, unstacked here to a static, non-overlapping layout * because its fly-away slice needs clamp(); * sv-spread, no fallback rule, its selector parses fine and * there is simply no translate/rotate left to apply. * sv-split-rise has no fallback rule either, but its floor is not * one line: below :is() support the rule is dropped whole and it * is fully static, above it the opacity declaration still * transitions, so it fades in without rising. * sv-reading falls back to fully-visible text; sv-counter and * sv-view-* stay progressive. * Installing the sheet also marks with data-sv-compat: the pin * presets above animate from --sv-pin, so styles/pin.css keeps the * stage pinned and the driver keeps writing the tall wrapper height * instead of releasing both, which is what a page with no compat() * wants down here. * * Syntax floor stays the consumer's job: the dist ships ES2020; if you must * PARSE on very old engines, let your bundler downlevel it (Next.js already * transpiles per browserslist via transpilePackages). */ /** Apply the patches this browser needs. Returns true if anything was patched. */ export declare function compat(): boolean;