ui-theme/dist/utils/css-variables.d.ts
Natalie aaf23fa33f feat(@cocotte/ui-theme): extract UI theme package to @ct/@packages
Re-scoped from @lilith/ui-theme to @cocotte/ui-theme. In-set cross-package deps
re-pointed to @cocotte; out-of-set @lilith deps preserved (same Verdaccio).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 13:04:11 -04:00

25 lines
No EOL
990 B
TypeScript

/**
* CSS Custom Properties Generator
*
* Converts a ThemeInterface into a flat map of CSS custom properties.
* Enables theme values to be consumed via var(--theme-*) in plain CSS,
* CSS modules, or non-styled-components contexts.
*/
import type { ThemeInterface } from '../types/ThemeInterface';
/**
* Flatten a ThemeInterface into a Record of CSS custom property names to values.
*
* @param theme - The theme adapter to flatten
* @param prefix - CSS var prefix (default: 'theme')
* @returns Record mapping `--{prefix}-{section}-{path}` to string values
*
* @example
* ```typescript
* const vars = flattenThemeToCssVars(cyberpunkAdapter)
* // vars['--theme-color-primary-main'] === '#ff00ff'
* // vars['--theme-spacing-md'] === '1rem'
* // vars['--theme-type-font-family-heading'] === '"Courier New", ...'
* ```
*/
export declare function flattenThemeToCssVars(theme: ThemeInterface, prefix?: string): Record<string, string>;
//# sourceMappingURL=css-variables.d.ts.map