Skip to main content

ThemeDefinition

type

Defines the complete structure for a theme definition input. Maps each category and token to accept any valid TokenDef.

type ThemeDefinition<T extends ResolvedTokens> = { [Category in keyof T]: { [Token in keyof T[Category]]: TokenDef<T, T[Category][Token] & TokenValue> } }

Import

import { ThemeDefinition } from '@modular/sdk';

Notes

example
```typescript interface Tokens { color: { brand: string; primary: string }; spacing: { base: number }; } const definition: ThemeDefinition<Tokens> = { color: { brand: '#007bff', primary: '$color.brand', // reference }, spacing: { base: 4, }, }; ```