@themed.js/core
v0.1.0
Published
Framework-agnostic theme management library with AI-powered theme generation
Maintainers
Readme
@themed.js/core
Core library for Themed.js - a powerful theme management system with AI-powered theme generation.
Installation
npm install @themed.js/coreUsage
import { createThemed } from '@themed.js/core';
// Create instance
const themed = createThemed({
defaultTheme: 'light',
ai: {
provider: 'openai',
apiKey: 'sk-xxx',
},
});
// Initialize
await themed.init();
// Apply theme
themed.apply('dark');
// Generate AI theme
const theme = await themed.generate('A cozy winter theme with warm colors');CSS Variables
Use the injected CSS variables in your styles:
body {
background-color: var(--themed-color-background);
color: var(--themed-color-text-primary);
font-family: var(--themed-font-family-sans);
}API
createThemed(options)
Creates a ThemeManager instance.
ThemeManager
init()- Initialize the managerregister(theme)- Register a themeapply(themeId)- Apply a themegenerate(prompt)- Generate AI themegetActive()- Get current themegetAll()- Get all themeson(event, handler)- Subscribe to events
License
MIT
