drizzle-cube 0.1.33 → 0.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -156,45 +156,60 @@ function App() {
156
156
  ✅ **Full Type Safety** - Complete TypeScript inference
157
157
  ✅ **All SQL Features** - Joins, CTEs, subqueries, window functions
158
158
  ✅ **Cube.js Compatibility** - Drop-in replacement for existing apps
159
- ✅ **Light/Dark Themes** - Automatic theme support with CSS custom properties
159
+ ✅ **Scalable Theming** - Built-in themes (light/dark/neon) with semantic CSS variables
160
160
 
161
161
  ## Theming
162
162
 
163
- Drizzle Cube supports light and dark themes out of the box. All components automatically adapt to your app's theme using CSS custom properties.
163
+ Drizzle Cube features a **scalable semantic theming system** with three built-in themes. All components automatically adapt using CSS variables - no component changes needed when adding new themes!
164
+
165
+ ### Built-in Themes
166
+
167
+ 🌞 **Light** - Clean white backgrounds with blue accents
168
+ 🌙 **Dark** - Slate grays with lighter blue highlights
169
+ ⚡ **Neon** - Bold fluorescent colors with deep purple backgrounds
164
170
 
165
171
  ### Quick Start
166
172
 
167
173
  ```typescript
168
- import { isDarkMode, watchThemeChanges } from 'drizzle-cube/client'
174
+ import { getTheme, setTheme, watchThemeChanges } from 'drizzle-cube/client'
169
175
 
170
- // Toggle dark mode
171
- document.documentElement.classList.toggle('dark')
176
+ // Set a theme programmatically
177
+ setTheme('neon') // 'light' | 'dark' | 'neon'
172
178
 
173
- // Or use data-theme attribute
174
- document.documentElement.setAttribute('data-theme', 'dark')
179
+ // Get current theme
180
+ const currentTheme = getTheme()
175
181
 
176
182
  // Watch for theme changes
177
- watchThemeChanges((isDark) => {
178
- console.log('Theme changed:', isDark ? 'dark' : 'light')
183
+ watchThemeChanges((theme) => {
184
+ console.log('Theme changed:', theme)
179
185
  })
180
186
  ```
181
187
 
182
- ### Customization
188
+ ### Adding Custom Themes
183
189
 
184
- Override CSS variables in your app's stylesheet:
190
+ Create your own theme by defining CSS variables - **zero component changes required**:
185
191
 
186
192
  ```css
187
- :root {
188
- --dc-primary: #3b82f6; /* Primary color */
189
- --dc-surface: #ffffff; /* Background */
190
- --dc-text: #111827; /* Text color */
193
+ [data-theme="ocean"] {
194
+ /* Surface colors */
195
+ --dc-surface: #001f3f;
196
+ --dc-surface-secondary: #002b5c;
197
+ --dc-card-bg: #003366;
198
+
199
+ /* Text colors */
200
+ --dc-text: #e6f7ff;
201
+ --dc-text-secondary: #b3d9ff;
202
+
203
+ /* Primary/accent colors */
204
+ --dc-primary: #39cccc;
205
+ --dc-border: #004d66;
206
+ /* ... other semantic variables */
191
207
  }
208
+ ```
192
209
 
193
- .dark {
194
- --dc-primary: #60a5fa;
195
- --dc-surface: #1e293b;
196
- --dc-text: #f1f5f9;
197
- }
210
+ Then update your theme toggle to include the new theme:
211
+ ```typescript
212
+ setTheme('ocean') // It just works! ✨
198
213
  ```
199
214
 
200
215
  **[Complete Theming Guide →](./docs/THEMING.md)**