Skip to main content

Function: toTailwindTheme()

toTailwindTheme(theme): TailwindThemeConfig

Defined in: adapters/toTailwindTheme.ts:75

Convert a ThemeTokensV2 into CSS custom properties and a Tailwind config.

Parameters

theme

ThemeTokensV2

Returns

TailwindThemeConfig

Example

import { themes, toTailwindTheme } from '@ttoss/theme2';

const tw = toTailwindTheme(themes.default);
// Inject CSS: tw.toCssString()
// Use config: tw.config.colors['brand-main']