intentFgExpr
Commons
stable
Builds the CSS var() expression for the foreground (text) color of an intent token at a given interaction role. The foreground color stays constant across hover/active — only disabled gets a distinct token.
API
Signature
Full TypeScript signature sourced from the util file.
API
Parameters
Input parameters accepted by this util.
- intentrequiredTIntent
- The semantic intent: primary, secondary, ghost, neutral, success, warning, danger, or info.
- _rolerequiredTBgFgRole
- rolerequiredTBgFgRole
- The interaction state: default, hover, active, or disabled. Only disabled produces a different token (fgDisabled); hover and active use the same fg as default.
API
Return value
The value returned by this util.
- A CSS var() expression string referencing the fg or fgDisabled token for the given intent.
Usage
Examples
Ready-to-paste usage snippets.
Generate intent foreground expressions