color
radialGradient
Builds a radial-gradient(...) value string for any background-image use.
import { radialGradient } from "@sdxc/u/color";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.radialGradient("circle", "red", "blue") | "radial-gradient(circle, red, blue)" |
u.radialGradient("circle at top left", { color: "red", position: "20%" }, "blue") | "radial-gradient(circle at top left, red 20%, blue)" |
Using a custom value
Every scale argument also takes a raw CSS value, which passes through untouched.
u.radialGradient("circle", "red", "blue")Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.radialGradient("circle", "red", "blue"))Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.radialGradient("circle", "red", "blue"))Signature
u.radialGradient(shape: GradientShape, ...stops: GradientStop[])