Skip to content

pantoken-root / packages/core/src / PantokenPlugin

Interface: PantokenPlugin ​

Beta

A pantoken plugin. Every hook is optional; a plugin participates only in the stages it defines a hook for. The same plugin can therefore inject at more than one layer.

Properties ​

name ​

name: string

Beta

A unique, human-readable plugin name.

Methods ​

tokens()? ​

optional tokens(ctx): void | Token[]

Beta

Token stage: return the full replacement token list.

Parameters ​

ctx ​

TokenHookContext

Returns ​

void | Token[]


icons()? ​

optional icons(ctx): void | IconEntry[]

Beta

Icon stage: return new IconEntry records to register as <image> tokens. Returning undefined or an empty array leaves the current set unchanged.

Parameters ​

ctx ​

IconHookContext

Returns ​

void | IconEntry[]


css()? ​

optional css(ctx): void | CssContribution

Beta

CSS stage: contribute or post-process CSS.

Parameters ​

ctx ​

CssHookContext

Returns ​

void | CssContribution


rehype()? ​

optional rehype(ctx): void | { resolve?: IconResolver; }

Beta

Rehype stage: provide a resolver merged into the rehype plugin.

Parameters ​

ctx ​

RehypeHookContext

Returns ​

void | { resolve?: IconResolver; }


native()? ​

optional native(ctx): void

Beta

Native stage (Style Dictionary): register transforms/formats.

Parameters ​

ctx ​

unknown

Returns ​

void