resolveGradient
Commons
stable
Normalise a gradient value (preset key, CSS gradient string, or IGradient object) into a CSS gradient string for use in background-image or text-clip. Returns an empty string for non-gradient inputs.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- valuerequiredTColor | IGradient
- The gradient input: a preset key string (e.g. "preset:aurora"), a raw CSS gradient string (linear-gradient/radial-gradient/…), an IGradient config object, or any other value (returns empty string).
API
Return value
The value returned by this util.
- A CSS gradient string (preset token var or inline gradient expression), or an empty string when the input is not a gradient.
Usage
Examples
Ready-to-paste usage snippets.
Resolve preset and raw gradient values