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

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

API

Return value

The value returned by this 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

Examples

Ready-to-paste usage snippets.

Apply intent surface styles

typescript