drizzle-cube 0.1.33 → 0.1.34
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 +35 -20
- package/dist/client/chunks/{components-BXU3r9yv.js → components-CKoo4sL3.js} +2844 -2813
- package/dist/client/chunks/components-CKoo4sL3.js.map +1 -0
- package/dist/client/components.js +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +25 -23
- package/dist/client/styles.css +1 -1
- package/dist/client/theme/index.d.ts +36 -2
- package/dist/client-bundle-stats.html +1 -1
- package/package.json +1 -1
- package/dist/client/chunks/components-BXU3r9yv.js.map +0 -1
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
|
-
✅ **
|
|
159
|
+
✅ **Scalable Theming** - Built-in themes (light/dark/neon) with semantic CSS variables
|
|
160
160
|
|
|
161
161
|
## Theming
|
|
162
162
|
|
|
163
|
-
Drizzle Cube
|
|
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 {
|
|
174
|
+
import { getTheme, setTheme, watchThemeChanges } from 'drizzle-cube/client'
|
|
169
175
|
|
|
170
|
-
//
|
|
171
|
-
|
|
176
|
+
// Set a theme programmatically
|
|
177
|
+
setTheme('neon') // 'light' | 'dark' | 'neon'
|
|
172
178
|
|
|
173
|
-
//
|
|
174
|
-
|
|
179
|
+
// Get current theme
|
|
180
|
+
const currentTheme = getTheme()
|
|
175
181
|
|
|
176
182
|
// Watch for theme changes
|
|
177
|
-
watchThemeChanges((
|
|
178
|
-
console.log('Theme changed:',
|
|
183
|
+
watchThemeChanges((theme) => {
|
|
184
|
+
console.log('Theme changed:', theme)
|
|
179
185
|
})
|
|
180
186
|
```
|
|
181
187
|
|
|
182
|
-
###
|
|
188
|
+
### Adding Custom Themes
|
|
183
189
|
|
|
184
|
-
|
|
190
|
+
Create your own theme by defining CSS variables - **zero component changes required**:
|
|
185
191
|
|
|
186
192
|
```css
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
--dc-surface: #
|
|
190
|
-
--dc-
|
|
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
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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)**
|