Skip to content
HomePagesHomePages template kit

TokenThemeSchema

Validates a template's design-token declaration: the colors/fonts/type/radii/shadows/layout token groups, an optional font-loading block, and the document defaults (which font/color/background/font-size dress `body`).

Validates a template’s design-token declaration: the colors/fonts/type/radii/shadows/layout token groups, an optional font-loading block, and the document defaults (which font/color/background/font-size dress body). Every document.* reference must name a token actually declared in its group, and a name may not be declared in both colors and type — both compile to the same text-<name> utility, and which would win is not defined.

Import from @homepages/template-kit.

const TokenThemeSchema: z.ZodObject<{ colors: z.ZodRecord<z.ZodString, z.ZodString>; fonts: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{ family: z.ZodString; fallback: z.ZodEnum<{ "sans-serif": "sans-serif"; serif: "serif"; monospace: "monospace"; }>; files: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{ src: z.ZodString; weight: z.ZodString; style: z.ZodOptional<z.ZodEnum<{ normal: "normal"; italic: "italic"; }>>; subset: z.ZodOptional<z.ZodEnum<{ latin: "latin"; "latin-ext": "latin-ext"; cyrillic: "cyrillic"; "cyrillic-ext": "cyrillic-ext"; greek: "greek"; "greek-ext": "greek-ext"; vietnamese: "vietnamese"; }>>; }, z.core.$strict>>>>; href: z.ZodOptional<z.ZodString>; }, z.core.$strict>]>>; type: z.ZodRecord<z.ZodString, z.ZodString>; radii: z.ZodRecord<z.ZodString, z.ZodString>; shadows: z.ZodRecord<z.ZodString, z.ZodString>; layout: z.ZodRecord<z.ZodString, z.ZodString>; breakpoints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; document: z.ZodObject<{ font: z.ZodString; color: z.ZodString; background: z.ZodString; fontSize: z.ZodString; }, z.core.$strict>; }, z.core.$strict>