Skip to content

pantoken / packages/plugin-kit/src / definePlugin

Mahi: definePlugin()

definePlugin(config): PantokenPlugin

Beta

Hangaia he mono pantoken mai i ōna hono. Ko te putanga he noa PantokenPlugin kua tohu ā-ahua me ngā pūkenga i whakatauhia mai i ngā hono i tukuna e koe.

Ngā Tawhā

config

PantokenPlugin

Ko te mono name me ētahi o ngā hono tokens/icons/css/rehype/native.

Whakahokia

PantokenPlugin

He PantokenPlugin kua tohu ā-ahua.

Tauira

He mono kotahi mō ngā token me te CSS

ts
import { capabilitiesOf, definePlugin } from "@pantoken/plugin-kit";

const brand = definePlugin({
  name: "@acme/brand",
  tokens: (ctx) => [
    ...ctx.tokens,
    ctx.define({ name: "--instui-brand", value: "var(--instui-color-background-brand)" }),
  ],
  css: () => ({ append: ":root { color-scheme: light dark; }" }),
});

capabilitiesOf(brand); // → ["tokens", "css"]