responsive
supports
A feature-query wrapper, applying the given utilities only when the browser supports query — progressive enhancement for CSS features without a reliable fallback path other than "don't apply this at all".
import { supports } from "@sdxc/u/responsive";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.supports("(corner-shape: squircle)", u.corner("squircle")) | css({ "@supports (corner-shape: squircle)": { cornerShape: "squircle" } }) |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.supports("(corner-shape: squircle)", u.corner("squircle"))Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.supports("(corner-shape: squircle)", u.corner("squircle")))Signature
u.supports(query: string, input: UtilityInput<Node>)