UNPKG

@archway-kit/vue

Version:

Vue components to interact with the Archway network

25 lines (24 loc) 898 B
import { SYSTEM_PREFERENCE } from '../consts'; export type ThemeId = string; export type ColorMode = 'light' | 'dark'; export type SystemThemePreference = typeof SYSTEM_PREFERENCE; export type ThemeConfig<T extends ThemeId> = { id: T; isDark?: boolean; }; export type DarkThemeConfig<T extends ThemeId> = ThemeConfig<T> & { isDark: true; }; export type LightThemeConfig<T extends ThemeId> = ThemeConfig<T> & { isDark: false; }; export type ThemesConfig<T extends ThemeId> = { /** Available themes */ themes: ThemeConfig<T>[]; /** Fallback theme to use when no specific theme selected. @default null // i.e. system theme */ fallback?: T | ColorMode | SystemThemePreference; /** Key to use to store the selected theme */ localStorageKey?: string; /** Html element to apply the theme-related classes to. @default documnet */ container?: HTMLElement; };