Skip to main content

exportThemeToCSS()

function exportThemeToCSS(theme): string

Exports the theme to CSS Variables on the root element

Parameters

ParameterTypeDescription
themeColorThemeThe theme to export

Returns

string

The CSS code for the theme

Example

const theme = generateTheme({ baseColor: '#ff0000', expandPalette: true });
exportThemeToCSS(theme);
// returns ':root { --color-primary-500: #ff0000; }'

Defined in

tailwind/tailwind.ts:173