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.

typescript

API

Parameters

Input parameters accepted by this util.

intent
required
TIntent
The semantic intent: primary, secondary, ghost, neutral, success, warning, danger, or info.
_role
required
TBgFgRole
role
required
TBgFgRole
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

typescript