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>
25 lines
No EOL
990 B
TypeScript
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
|