tokenStylesForIntent

Commons
stable

Build a CSS-vars override map (background-color + color) for a given intent and interaction role. Returns the correct token expressions for default, hover, active, and disabled states.

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", "success", "warning", "danger", "info", or "neutral".
role
TBgFgRole
BG_FG_ROLE.DEFAULT
The interaction state: "default" | "hover" | "active" | "disabled". Defaults to "default".

API

Valeur de retour

La valeur retournée par cet util.

An object with two keys — `background-color` and `color` — each holding a `var(--origam-color__…)` expression. Bind it directly as a `:style` object.

Usage

Exemples

Extraits de code prêts à coller.

Apply intent surface styles

typescript