UNPKG

stoop

Version:

CSS-in-JS library with type inference, theme creation, and variants support.

31 lines (30 loc) 1.16 kB
/** * Theme variable management. * Updates CSS custom properties when theme changes. * Ensures CSS variables are injected and kept in sync with theme updates. * Automatically merges themes with the default theme when applied. */ import type { Theme } from "../types"; /** * Registers the default theme for a given prefix. * Called automatically by createStoop. * * @param theme - Default theme from createStoop * @param prefix - Optional prefix for theme scoping */ export declare function registerDefaultTheme(theme: Theme, prefix?: string): void; /** * Gets the default theme for a given prefix. * * @param prefix - Optional prefix for theme scoping * @returns Default theme or null if not registered */ export declare function getDefaultTheme(prefix?: string): Theme | null; /** * Updates CSS custom properties when theme changes. * Automatically merges the theme with the default theme to ensure all properties are present. * * @param theme - Theme object to generate CSS variables from * @param prefix - Optional prefix for CSS variable names */ export declare function updateThemeVariables(theme: Theme, prefix?: string): void;