UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

10 lines (9 loc) 691 B
export type RanThemeName = 'light' | 'dark' | 'system'; export type ThemeTarget = HTMLElement | Document; export type ThemeTokenMap = Record<string, string | number | null | undefined>; export declare const setTheme: (name: RanThemeName, target?: ThemeTarget) => void; export declare const getTheme: (target?: ThemeTarget) => RanThemeName | ''; export declare const setThemeToken: (name: string, value: string | number, target?: HTMLElement) => void; export declare const clearThemeToken: (name: string, target?: HTMLElement) => void; export declare const setThemeTokens: (tokens: ThemeTokenMap, target?: HTMLElement) => void; export declare const initTheme: (target?: ThemeTarget) => void;