react-theme-system
Version:
A comprehensive React theme management system that enforces consistency, supports dark/light mode, and eliminates hardcoded styles
27 lines (26 loc) • 834 B
TypeScript
import { Theme, ThemeConfig, ValidTheme } from '../types';
/**
* Theme configuration helper
* Creates a validated theme configuration with fallbacks
*/
export declare const createThemeConfig: (config: Partial<ThemeConfig>) => ThemeConfig;
/**
* Theme validation function
*/
export declare const isValidTheme: (theme: string) => theme is ValidTheme;
/**
* Get theme from localStorage with fallback
*/
export declare const getStoredTheme: (defaultTheme?: ValidTheme) => ValidTheme;
/**
* Set theme in localStorage
*/
export declare const setStoredTheme: (theme: ValidTheme) => void;
/**
* Convert theme object to CSS variables
*/
export declare const themeToCSSVariables: (theme: Theme) => Record<string, string>;
/**
* Apply theme CSS variables to document
*/
export declare const applyThemeToDOM: (theme: Theme) => void;