theme

@motioneffector/theme

Type-safe theme management with CSS variables, runtime switching, and automatic persistence.

npm version license TypeScript

Features

Read the full manual →

Quick Start

import { createThemeManager, createTheme } from '@motioneffector/theme'

// Define your themes
const light = createTheme({
  name: 'light',
  tokens: { primary: '#007bff', background: '#ffffff', text: '#000000' }
})

const dark = createTheme({
  name: 'dark',
  tokens: { primary: '#0d6efd', background: '#1a1a1a', text: '#ffffff' }
})

// Create manager and switch themes
const manager = createThemeManager({
  themes: [light, dark],
  defaultTheme: 'light',
  storageKey: 'app-theme'
})

manager.apply('dark')

Testing & Validation

License

MIT © motioneffector