overflow
scroll-snap-type
Applies scroll-snap-type to a scroll container, defaulting to "inline mandatory", the paged-carousel case; pass "none" to disable snapping.
import { scrollSnapType } from "@sdxc/u/overflow";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.scrollSnapType() | css({ scrollSnapType: "inline mandatory" }) |
u.scrollSnapType("block", "proximity") | css({ scrollSnapType: "block proximity" }) |
u.scrollSnapType("none") | css({ scrollSnapType: "none" }) |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.scrollSnapType()Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.scrollSnapType())Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.scrollSnapType())Signature
u.scrollSnapType(axis?: ScrollSnapAxis | "none", strictness?: ScrollSnapStrictness)