@howssatoshi/quantumcss 1.1.0 → 1.3.0

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
@@ -1,486 +1,92 @@
1
1
  # Quantum CSS - Next-Generation Utility Framework
2
2
 
3
- ![Quantum CSS](https://img.shields.io/badge/Quantum%20CSS-v1.0.0-blue)
3
+ ![Quantum CSS](https://img.shields.io/badge/Quantum%20CSS-v1.3.0-blue)
4
4
  ![License](https://img.shields.io/badge/license-MIT-green)
5
- ![Bundle Size](https://img.shields.io/badge/bundle%20size-6.2KB-brightgreen)
5
+ ![Bundle Size](https://img.shields.io/badge/bundle%20size-15KB-brightgreen)
6
6
 
7
- A modern, performance-optimized utility-first CSS framework with semantic naming, component-aware utilities, and advanced CSS features.
7
+ A modern, performance-optimized utility-first CSS framework with semantic naming, recursive component presets, and advanced cosmic effects.
8
8
 
9
9
  ## 🚀 Features
10
10
 
11
11
  ### Modern CSS Capabilities
12
- - **Container Queries** - Query container elements instead of viewport
13
- - **Logical Properties** - Use `margin-inline`, `padding-block`, etc.
14
- - **CSS Custom Properties** - Design tokens and CSS variables
15
- - **Modern Selectors** - `:where()`, `:is()`, and CSS nesting
16
-
17
- ### Enhanced Utilities
18
- - **500+ Utility Classes** - Comprehensive coverage
19
- - **Starlight Aesthetics** - Ethereal design system with glassmorphism, atmospheric glows, and vibrant gradients
20
- - **Component Utilities** - Pre-built button, card, form components
21
- - **State Variants** - Hover, focus, active, disabled states
22
- - **Dark Mode** - Automatic and manual dark mode support
23
- - **Responsive Variants** - Mobile-first with container queries
12
+ - **Recursive Component Presets** - Define custom components in config using existing utilities
13
+ - **Cosmic Animation Library** - Advanced effects like parallax nebula drifts and orbit paths
14
+ - **High Contrast Mode** - Native support for `prefers-contrast` and `forced-colors`
15
+ - **JIT Dark Mode** - Dynamic generation of dark mode variants via `dark:` prefix
24
16
 
25
17
  ### Developer Experience
26
- - **Zero Configuration** - Works out of the box
18
+ - **Advanced CLI Scaffolding** - Instantly generate pre-styled templates (Gaming, Blog, News, Shopping, Travel)
19
+ - **Dynamic Documentation** - Generate a "Kitchen Sink" overview of your unique design tokens
27
20
  - **TypeScript Support** - Full type definitions
28
- - **Build Tools** - Custom build system with analysis
29
- - **Small Bundle Size** - 15KB gzipped, optimized for performance
21
+ - **Zero Configuration** - Works out of the box
30
22
 
31
23
  ## 📦 Installation
32
24
 
33
25
  ```bash
34
- # npm
35
26
  npm install @howssatoshi/quantumcss
36
-
37
- # yarn
38
- yarn add @howssatoshi/quantumcss
39
-
40
- # pnpm
41
- pnpm add @howssatoshi/quantumcss
42
27
  ```
43
28
 
44
29
  ## 🎯 Quick Start
45
30
 
46
- ### HTML Usage
47
- ```html
48
- <!DOCTYPE html>
49
- <html>
50
- <head>
51
- <link rel="stylesheet" href="dist/quantum.min.css">
52
- </head>
53
- <body>
54
- <div class="container mx-auto p-6 space-y-4">
55
- <h1 class="text-3xl font-bold text-primary mb-4">
56
- Hello QuantumCSS!
57
- </h1>
58
- <button class="btn btn-primary hover:scale-105 transition-all">
59
- Get Started
60
- </button>
61
- </div>
62
- </body>
63
- </html>
64
- ```
65
-
66
- ### CSS Import
67
- ```css
68
- @import '@howssatoshi/quantumcss/dist/quantum.min.css';
69
- ```
70
-
71
- ## 🎨 Utility Classes
72
-
73
- ### Layout
74
- ```html
75
- <div class="container mx-auto px-4">
76
- <div class="grid grid-cols-1 md:grid-cols-3 lg:grid-cols-12 gap-6">
77
- <div class="lg:col-span-8 card">Main Content</div>
78
- <div class="lg:col-span-4 card">Sidebar</div>
79
- </div>
80
- </div>
81
- ```
82
-
83
- ### Typography
84
- ```html
85
- <h1 class="text-4xl font-bold text-primary">Heading</h1>
86
- <p class="text-base text-neutral leading-relaxed">Paragraph text</p>
87
- <!-- Smart Typography: Large text sizes automatically include unitless line-heights -->
88
- <h2 class="text-5xl font-bold">Overlapping Fixed</h2>
89
- ```
90
-
91
- ### Colors
92
- ```html
93
- <!-- JIT Color Resolution: Support for base names and opacity -->
94
- <div class="bg-primary/10 text-primary p-4 rounded-lg border border-primary">
95
- <div class="text-secondary">Opacity and base color mapping</div>
96
- </div>
97
- ```
98
-
99
- ### Spacing
100
- ```html
101
- <div class="m-4 p-6 mb-8">
102
- <!-- Smart Spacing: space-y and space-x utilities for child elements -->
103
- <div class="space-y-4">
104
- <div class="py-2">Item 1</div>
105
- <div class="py-2">Item 2</div>
106
- </div>
107
- </div>
108
- ```
109
-
110
- ## 🧩 Component Utilities
111
-
112
- ### Buttons
113
- ```html
114
- <button class="btn btn-primary">Primary</button>
115
- <button class="btn btn-secondary btn-lg">Large</button>
116
- <button class="btn btn-outline">Outline</button>
117
- <button class="btn btn-ghost">Ghost</button>
118
- ```
119
-
120
- ### Forms
121
- ```html
122
- <input type="text" class="input" placeholder="Enter text">
123
- <input type="email" class="input input-error" placeholder="Error state">
124
- <select class="input">
125
- <option>Choose option</option>
126
- </select>
127
- ```
128
-
129
- ### Cards
130
- ```html
131
- <div class="card">
132
- <div class="card-header">
133
- <h3 class="text-xl font-semibold">Card Title</h3>
134
- </div>
135
- <div class="card-body">
136
- <p class="text-neutral">Card content goes here</p>
137
- </div>
138
- <div class="card-footer">
139
- <button class="btn btn-primary btn-sm">Action</button>
140
- </div>
141
- </div>
142
- ```
143
-
144
- ### Alerts
145
- ```html
146
- <div class="alert alert-success">Success message</div>
147
- <div class="alert alert-warning">Warning message</div>
148
- <div class="alert alert-error">Error message</div>
149
- <div class="alert alert-info">Info message</div>
150
- ```
151
-
152
- ### Badges
153
- ```html
154
- <!-- Enhanced Badges: Less rounded (0.375rem), 1px border, and glassmorphism compatible -->
155
- <span class="badge badge-primary">Primary</span>
156
- <span class="badge badge-secondary">Secondary</span>
157
- <span class="badge badge-success">Success</span>
158
- <span class="badge badge-warning">Warning</span>
159
- <span class="badge badge-error">Error</span>
160
- ```
161
-
162
- ## ✨ Starlight UI
163
-
164
- The Starlight theme provides a futuristic, ethereal design system inspired by modern AI interfaces and space aesthetics.
165
-
166
- ### Key Features
167
- - **Glassmorphism**: Hardware-accelerated blur effects with improved composability (`.glass`).
168
- - **Atmospheric Glows**: Soft, colored shadows that simulate light sources (`.glow-blue`, `.glow-peach`).
169
- - **Vibrant Gradients**: Carefully crafted color transitions (`.bg-starlight`, `.text-gradient-starlight`).
170
- - **Premium Components**: Enhanced variants including theme-aware links and layering-friendly containers.
171
-
172
- ### Example Usage
173
- ```html
174
- <div class="glass p-8 rounded-2xl glow-blue border-l-4 border-primary">
175
- <h2 class="text-starlight font-bold">Starlight Interface</h2>
176
- <p class="text-muted">Experience the future of styling with smart composability.</p>
177
- <button class="btn-starlight">
178
- Launch
179
- </button>
180
- </div>
181
- ```
182
-
183
- ## 📱 Responsive Design
184
-
185
- ### Breakpoint Variants
186
- ```html
187
- <div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4">
188
- <!-- Responsive grid -->
189
- </div>
190
- ```
191
-
192
- ### Container Queries (Advanced)
193
- ```html
194
- <div class="container" style="container-type: inline-size;">
195
- <div class="container:grid container:grid-cols-2 container:p-6">
196
- <!-- Container query responsive -->
197
- </div>
198
- </div>
199
- ```
200
-
201
- ### Dark Mode
202
- ```html
203
- <div class="bg-white dark:bg-gray-900 text-black dark:text-white">
204
- <!-- Automatic dark mode support -->
205
- </div>
206
- ```
207
-
208
- ## 🎯 State Variants
209
-
210
- ### Hover Effects
211
- ```html
212
- <button class="btn btn-primary hover:bg-primary-600 hover:scale-105">
213
- Hover me
214
- </button>
215
- <div class="card hover:shadow-lg hover:scale-105 transition-all">
216
- <!-- Interactive card -->
217
- </div>
218
- ```
219
-
220
- ### Focus States
221
- ```html
222
- <input class="input focus:ring-2 focus:ring-primary focus:border-primary">
223
- <button class="btn focus:outline-none focus:ring-2 focus:ring-primary">
224
- Accessible button
225
- </button>
226
- ```
227
-
228
- ### Active States
229
- ```html
230
- <button class="btn active:scale-95 active:bg-primary-700">
231
- Press me
232
- </button>
31
+ ### CLI Scaffolding
32
+ Quickly jumpstart your project with a premium template:
33
+ ```bash
34
+ npx @howssatoshi/quantumcss scaffold gaming index.html
233
35
  ```
36
+ *Available templates: `gaming`, `blog`, `news`, `shopping`, `travel`, `starlight`*
234
37
 
235
- ### Disabled States
38
+ ### HTML Usage
236
39
  ```html
237
- <button class="btn disabled:opacity-50 disabled:cursor-not-allowed" disabled>
238
- Disabled
40
+ <button class="btn-starlight ani-float">
41
+ Launch Experience
239
42
  </button>
240
43
  ```
241
44
 
242
45
  ## ⚙️ Configuration
243
46
 
244
- ### Basic Configuration
245
- Create `quantum.config.json`:
246
- ```json
247
- {
248
- "theme": {
249
- "extend": {
250
- "colors": {
251
- "brand": "#3b82f6",
252
- "accent": "#10b981"
253
- },
254
- "fontFamily": {
255
- "display": ["Inter", "system-ui", "sans-serif"]
256
- },
257
- "spacing": {
258
- "18": "4.5rem",
259
- "88": "22rem"
260
- }
261
- }
262
- },
263
- "darkMode": "media"
264
- }
265
- ```
266
-
267
- ### Build Configuration
47
+ ### Component Presets
48
+ Define your own components in `quantum.config.json`:
268
49
  ```json
269
50
  {
270
- "content": [
271
- "./src/**/*.{html,js,ts,jsx,tsx}"
272
- ],
273
- "presets": [
274
- "modern-css"
275
- ],
276
- "plugins": [
277
- "container-queries",
278
- "component-utilities"
279
- ]
51
+ "componentPresets": {
52
+ "btn-action": "btn-starlight px-8 py-3 rounded-xl hover:scale-105 transition",
53
+ "card-glass": "glass p-6 rounded-2xl border border-white/10 dark:bg-white/5"
54
+ }
280
55
  }
281
56
  ```
282
57
 
283
- ## 🛠️ Build Tools
284
-
285
- ### Development
286
- ```bash
287
- # Watch for changes and rebuild
288
- npm run watch
289
-
290
- # Build for development (not minified)
291
- npm run build:dev
292
-
293
- # Generate JIT utilities from content
294
- npm run generate
295
- ```
58
+ ## Cosmic Animations
296
59
 
297
- ### Production
298
- ```bash
299
- # Build minified CSS
300
- npm run build
60
+ Bring your UI to life with space-inspired effects:
61
+ - `.ani-nebula` - Ethereal drifting gradient backgrounds
62
+ - `.ani-float` - Floating vertical motion
63
+ - `.ani-twinkle` - Sparkling star effects
64
+ - `.ani-orbit` - Circular orbital paths
65
+ - `.ani-svg-draw` - Progressive path drawing for icons
301
66
 
302
- # Generate JIT utilities with custom output
303
- npx @howssatoshi/quantumcss dist/custom.css
304
- ```
67
+ ## 🛠️ Build Tools
305
68
 
306
- ### Build Analysis
69
+ ### Documentation
70
+ Generate a live dashboard of your theme:
307
71
  ```bash
308
- # Analyze CSS output
309
- npm run analyze
310
-
311
- # Output includes:
312
- # - Selector count
313
- # - Property usage
314
- # - Utility class count
315
- # - Component class count
316
- # - Responsive variant usage
317
- # - Color palette analysis
318
- # - Breakpoint distribution
319
- ```
320
-
321
- ## 🎨 Customization
322
-
323
- ### Adding Custom Colors
324
- ```css
325
- :root {
326
- --color-brand: #6366f1;
327
- --color-brand-50: #eef2ff;
328
- --color-brand-100: #e0e7ff;
329
- /* ... rest of scale */
330
- }
331
-
332
- .brand-text { color: var(--color-brand); }
333
- .brand-bg { background-color: var(--color-brand); }
334
- ```
335
-
336
- ### Custom Spacing Scale
337
- ```css
338
- :root {
339
- --space-14: 3.5rem;
340
- --space-72: 18rem;
341
- }
342
-
343
- .p-14 { padding: var(--space-14); }
344
- .m-72 { margin: var(--space-72); }
72
+ npm run docs
345
73
  ```
74
+ This creates `examples/kitchen-sink.html` with all your colors, spacing, presets, and animations.
346
75
 
347
- ### Custom Animations
348
- ```css
349
- @keyframes slideInFromLeft {
350
- from {
351
- transform: translateX(-100%);
352
- opacity: 0;
353
- }
354
- to {
355
- transform: translateX(0);
356
- opacity: 1;
357
- }
358
- }
359
-
360
- .animate-slide-left {
361
- animation: slideInFromLeft 0.3s ease-out;
362
- }
363
- ```
76
+ ### High Contrast Support
77
+ QuantumCSS automatically optimizes contrast for accessibility when the user enables high contrast mode in their OS.
364
78
 
365
79
  ## 📊 Performance
366
80
 
367
- ### Bundle Size Comparison
368
- - **QuantumCSS**: 15KB gzipped
369
- - **Bootstrap**: 25KB gzipped
370
- - **Bulma**: 20KB gzipped
371
-
372
- ### Performance Features
373
- - **CSS Custom Properties** - Faster theme switching
374
- - **Optimized Selectors** - Minimal specificity
375
- - **Tree Shaking** - Only used classes included
376
- - **Container Queries** - Better performance than media queries
377
- - **Logical Properties** - Better performance than directional properties
378
-
379
- ## 🧩 Advanced Components
380
-
381
- ### Modal
382
- ```html
383
- <div class="modal-overlay">
384
- <div class="modal-content">
385
- <div class="p-6">
386
- <h2 class="text-2xl font-bold mb-4">Modal Title</h2>
387
- <p class="text-neutral mb-6">Modal content</p>
388
- <div class="flex gap-2">
389
- <button class="btn btn-primary">Confirm</button>
390
- <button class="btn btn-outline">Cancel</button>
391
- </div>
392
- </div>
393
- </div>
394
- </div>
395
- ```
396
-
397
- ### Dropdown
398
- ```html
399
- <div class="dropdown">
400
- <button class="btn" onclick="toggleDropdown(this)">Menu</button>
401
- <div class="dropdown-content">
402
- <button class="dropdown-item">Item 1</button>
403
- <button class="dropdown-item">Item 2</button>
404
- <button class="dropdown-item">Item 3</button>
405
- </div>
406
- </div>
407
- ```
408
-
409
- ### Tabs
410
- ```html
411
- <div class="tab-list">
412
- <button class="tab-button active">Tab 1</button>
413
- <button class="tab-button">Tab 2</button>
414
- <button class="tab-button">Tab 3</button>
415
- </div>
416
- <div class="tab-content">
417
- <div class="tab-panel active">Content 1</div>
418
- <div class="tab-panel">Content 2</div>
419
- <div class="tab-panel">Content 3</div>
420
- </div>
421
- ```
422
-
423
- ### Accordion
424
- ```html
425
- <div class="accordion-item">
426
- <div class="accordion-header">
427
- <span>Accordion Title</span>
428
- <span class="accordion-icon">▼</span>
429
- </div>
430
- <div class="accordion-content">
431
- Accordion content
432
- </div>
433
- </div>
434
- ```
435
-
436
- ## 🎯 Best Practices
437
-
438
- ### Performance Tips
439
- 1. **Use Container Queries** for component-level responsiveness
440
- 2. **Leverage CSS Custom Properties** for dynamic theming
441
- 3. **Prefer Utility Classes** over custom CSS
442
- 4. **Use Logical Properties** for internationalization
443
- 5. **Optimize Bundle Size** with build analysis
444
-
445
- ### Accessibility
446
- ```html
447
- <!-- Accessible button -->
448
- <button class="btn focus:ring-2 focus:ring-primary focus:ring-offset-2">
449
- Accessible Button
450
- </button>
451
-
452
- <!-- Screen reader only text -->
453
- <span class="sr-only">Hidden from sight, visible to screen readers</span>
454
-
455
- <!-- Semantic markup -->
456
- <main class="container mx-auto" role="main">
457
- <h1 class="sr-only">Page title for screen readers</h1>
458
- </main>
459
- ```
81
+ ### Bundle Size
82
+ - **QuantumCSS Core**: ~15KB gzipped
83
+ - **Optimized Selectors**: Minimal specificity for maximum performance
84
+ - **Tree Shaking**: Only used utilities and presets are generated in JIT mode
460
85
 
461
86
  ## 🤝 Contributing
462
87
 
463
88
  We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
464
89
 
465
- ### Development Setup
466
- ```bash
467
- git clone https://github.com/macroadster/quantumcss.git
468
- cd quantumcss
469
- npm install
470
- npm run watch
471
- ```
472
-
473
90
  ## 📄 License
474
91
 
475
92
  MIT License - see [LICENSE](LICENSE) file for details.
476
-
477
- ## 🔗 Links
478
-
479
- - **Documentation**: https://github.com/macroadster/quantumcss#readme
480
- - **GitHub**: https://github.com/macroadster/quantumcss
481
- - **NPM**: https://npmjs.com/package/@howssatoshi/quantumcss
482
- - **Discord**: https://discord.gg/quantumcss
483
-
484
- ---
485
-
486
- **QuantumCSS** - The future of utility-first CSS frameworks. Built with modern CSS, designed for modern web development. 🚀