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
Signature TypeScript complète, extraite du fichier util.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- intentrequisTIntent
- The semantic intent: primary, secondary, ghost, neutral, success, warning, danger, or info.
- _rolerequisTBgFgRole
- rolerequisTBgFgRole
- 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
Valeur de retour
La valeur retournée par cet util.
- A CSS var() expression string referencing the fg or fgDisabled token for the given intent.
Usage
Exemples
Extraits de code prêts à coller.
Generate intent foreground expressions