overflow
scrollbar-gutter
Applies scrollbar-gutter, defaulting to "stable", so the container is already the size it settles at and content holds its position the moment a scrollbar appears.
import { scrollbarGutter } from "@sdxc/u/overflow";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.scrollbarGutter() | css({ scrollbarGutter: "stable" }) |
u.scrollbarGutter("stable both-edges") | css({ scrollbarGutter: "stable both-edges" }) |
u.scrollbarGutter("auto") | css({ scrollbarGutter: "auto" }) |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.scrollbarGutter()Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.scrollbarGutter())Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.scrollbarGutter())Signature
u.scrollbarGutter(value?: ScrollbarGutterValue)