responsive
contrastLess
Sugar over media("(prefers-contrast: less)", input).
import { contrastLess } from "@sdxc/u/responsive";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.contrastLess(u.border("neutral")) | css({ "@media (prefers-contrast: less)": { borderColor: "var(--ui-neutral-border)" } }) |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.contrastLess(u.border("neutral"))Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.contrastLess(u.border("neutral")))Customizing the theme
The custom properties this utility reads, which a theme redefines.
| Variable |
|---|
--ui-neutral-border |
Signature
u.contrastLess(input: UtilityInput<Node>)