intentBgExpr

Commons
stable

Builds the CSS color-mix() expression for the background of an intent token at a given interaction role (default, hover, active, disabled). Falls back gracefully when the token is absent by mixing the base bg with black.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

intent
requis
TIntent
The semantic intent: primary, secondary, ghost, neutral, success, warning, danger, or info.
role
requis
TBgFgRole
The interaction state: default, hover, active, or disabled. Hover and active darken the base bg via color-mix() when the explicit token is absent.

API

Valeur de retour

La valeur retournée par cet util.

A CSS var() or color-mix() expression string ready to assign to background-color.

Usage

Exemples

Extraits de code prêts à coller.

Generate intent background expressions

typescript