Skip to content

pantoken / packages/core/src / defineToken

Fušla: defineToken()

defineToken(input): Token

Behta

Geavahit duođalaš Token vuosttačálaš dáiddaid birra, defaulteat inherits ja syntax.

Parametera

input

TokenInput

Gullii / Gávdnat

Token

Exempla

Gihpat syntaksi konkretalaš gávdnonboaivviin

ts
import { defineToken } from "@pantoken/core";

defineToken({ name: "--instui-color-x", value: "#0374B5" });
// → { name: "--instui-color-x", syntax: "<color>", inherits: true, value: "#0374B5" }

Okta var()-gávdno registrer refererarTo; light-dark() sállá theme-miid

ts
import { defineToken } from "@pantoken/core";

defineToken({ name: "--instui-brand", value: "var(--instui-color-background-brand)" });
// → syntax "*", refersTo: "--instui-color-background-brand"

defineToken({ name: "--instui-bg", value: "light-dark(#fff, #000)" });
// → syntax "*", themed: true