Skip to content

pantoken / packages/plugin-kit/src / definePlugin

Feidhm: definePlugin()

definePlugin(config): PantokenPlugin

Béite

Cruthaigh breiseán pantoken óna chrochaí. Is é an toradh PantokenPlugin gnáth, brandaithe leis na cumais a mholtar ón gcruach a sholáthraigh tú.

Paraiméadair

config

PantokenPlugin

An breiseán name chomh maith le haon cheann de na crochaí tokens/icons/css/rehype/native.

Tuairisceáin

PantokenPlugin

Breiseán brandaithe PantokenPlugin.

Sampla

Breiseán aonaithe tokenanna + 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"]