jasmincss 1.0.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 +524 -0
- package/bin/jasmin.js +45 -0
- package/dist/index.d.ts +62 -0
- package/dist/index.js +14568 -0
- package/dist/index.mjs +14524 -0
- package/dist/jasmin.css +63308 -0
- package/dist/jasmin.min.css +1 -0
- package/dist/plugins/nextjs.js +14777 -0
- package/dist/plugins/nextjs.mjs +14747 -0
- package/dist/plugins/vite.js +14889 -0
- package/dist/plugins/vite.mjs +14860 -0
- package/package.json +101 -0
- package/src/cli/add.js +83 -0
- package/src/cli/init.js +210 -0
- package/src/cli/run.js +142 -0
- package/src/components/accordion.js +309 -0
- package/src/components/alerts.js +357 -0
- package/src/components/avatars.js +331 -0
- package/src/components/badges.js +353 -0
- package/src/components/buttons.js +412 -0
- package/src/components/cards.js +342 -0
- package/src/components/carousel.js +495 -0
- package/src/components/chips.js +440 -0
- package/src/components/command-palette.js +434 -0
- package/src/components/datepicker.js +517 -0
- package/src/components/dropdown.js +411 -0
- package/src/components/forms.js +516 -0
- package/src/components/index.js +81 -0
- package/src/components/modals.js +349 -0
- package/src/components/navigation.js +463 -0
- package/src/components/offcanvas.js +390 -0
- package/src/components/popover.js +427 -0
- package/src/components/progress.js +396 -0
- package/src/components/rating.js +394 -0
- package/src/components/skeleton.js +408 -0
- package/src/components/spinner.js +453 -0
- package/src/components/stepper.js +389 -0
- package/src/components/tables.js +304 -0
- package/src/components/timeline.js +452 -0
- package/src/components/timepicker.js +529 -0
- package/src/components/tooltips.js +345 -0
- package/src/components/upload.js +490 -0
- package/src/config/defaults.js +263 -0
- package/src/config/loader.js +109 -0
- package/src/core/base.js +241 -0
- package/src/core/compiler.js +135 -0
- package/src/core/utilities/accessibility.js +290 -0
- package/src/core/utilities/animations.js +205 -0
- package/src/core/utilities/background.js +109 -0
- package/src/core/utilities/colors.js +234 -0
- package/src/core/utilities/columns.js +161 -0
- package/src/core/utilities/effects.js +261 -0
- package/src/core/utilities/filters.js +135 -0
- package/src/core/utilities/icons.js +806 -0
- package/src/core/utilities/index.js +239 -0
- package/src/core/utilities/layout.js +321 -0
- package/src/core/utilities/scroll.js +205 -0
- package/src/core/utilities/spacing.js +120 -0
- package/src/core/utilities/svg.js +191 -0
- package/src/core/utilities/transforms.js +116 -0
- package/src/core/utilities/typography.js +188 -0
- package/src/index.js +7 -0
- package/src/js/components/accordion.js +154 -0
- package/src/js/components/alert.js +198 -0
- package/src/js/components/carousel.js +226 -0
- package/src/js/components/dropdown.js +166 -0
- package/src/js/components/modal.js +169 -0
- package/src/js/components/offcanvas.js +175 -0
- package/src/js/components/popover.js +221 -0
- package/src/js/components/tabs.js +163 -0
- package/src/js/components/tooltip.js +200 -0
- package/src/js/index.js +79 -0
- package/src/js/types/config.d.ts +228 -0
- package/src/js/types/index.d.ts +439 -0
- package/src/plugins/nextjs.js +100 -0
- package/src/plugins/vite.js +133 -0
package/README.md
ADDED
|
@@ -0,0 +1,524 @@
|
|
|
1
|
+
# JasminCSS
|
|
2
|
+
|
|
3
|
+
A modern, utility-first CSS framework with 26 components, 720 icons, JavaScript behaviors, and powerful CLI tooling.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **14 Utility Categories** - Layout, spacing, typography, colors, effects, animations, transforms, filters, icons, background, columns, scroll, SVG, accessibility
|
|
8
|
+
- **26 Pre-built Components** - Buttons, cards, modals, dropdowns, accordions, carousels, and more
|
|
9
|
+
- **720 Built-in Icons** - CSS-based icon system using masks
|
|
10
|
+
- **JavaScript Behaviors** - Zero-dependency, accessible component interactions
|
|
11
|
+
- **Dark Mode** - First-class support with `dark:` prefix
|
|
12
|
+
- **Tree-Shaking** - Only include CSS you use in production
|
|
13
|
+
- **TypeScript Support** - Full type definitions included
|
|
14
|
+
- **VS Code Extension** - IntelliSense for class autocomplete
|
|
15
|
+
- **CLI Branding Wizard** - Interactive setup for colors, typography, and style
|
|
16
|
+
- **Framework Plugins** - First-class support for Next.js and Vite
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install jasmincss
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### CDN
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<link rel="stylesheet" href="https://unpkg.com/jasmincss/dist/jasmin.min.css">
|
|
28
|
+
<script src="https://unpkg.com/jasmincss/dist/jasmin.min.js"></script>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<!DOCTYPE html>
|
|
35
|
+
<html lang="en">
|
|
36
|
+
<head>
|
|
37
|
+
<meta charset="UTF-8">
|
|
38
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
39
|
+
<link rel="stylesheet" href="node_modules/jasmincss/dist/jasmin.css">
|
|
40
|
+
<title>My App</title>
|
|
41
|
+
</head>
|
|
42
|
+
<body>
|
|
43
|
+
<button class="btn btn-primary">Click me</button>
|
|
44
|
+
|
|
45
|
+
<script type="module">
|
|
46
|
+
import Jasmin from 'jasmincss/js';
|
|
47
|
+
Jasmin.autoInit();
|
|
48
|
+
</script>
|
|
49
|
+
</body>
|
|
50
|
+
</html>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Components
|
|
54
|
+
|
|
55
|
+
JasminCSS includes 26 pre-built components:
|
|
56
|
+
|
|
57
|
+
| Component | Description | JS Required |
|
|
58
|
+
|-----------|-------------|-------------|
|
|
59
|
+
| Buttons | Primary, secondary, outline, ghost, sizes | No |
|
|
60
|
+
| Cards | Content containers with header/body/footer | No |
|
|
61
|
+
| Forms | Inputs, select, checkbox, radio, switch | No |
|
|
62
|
+
| Navigation | Navbar, sidebar, breadcrumb, tabs | Yes (tabs) |
|
|
63
|
+
| Alerts | Info, success, warning, error messages | Yes (dismiss) |
|
|
64
|
+
| Badges | Labels, tags, status indicators | No |
|
|
65
|
+
| Modals | Dialog boxes with focus trapping | Yes |
|
|
66
|
+
| Tables | Data tables with styling variants | No |
|
|
67
|
+
| Avatars | User profile images | No |
|
|
68
|
+
| Tooltips | Hover information | Yes |
|
|
69
|
+
| Progress | Progress bars, loading indicators | No |
|
|
70
|
+
| Skeleton | Loading placeholders | No |
|
|
71
|
+
| Dropdown | Dropdown menus with keyboard nav | Yes |
|
|
72
|
+
| Accordion | Collapsible panels | Yes |
|
|
73
|
+
| Chips | Tags, filters, selections | No |
|
|
74
|
+
| Offcanvas | Slide-out panels, drawers | Yes |
|
|
75
|
+
| Carousel | Image/content sliders | Yes |
|
|
76
|
+
| Stepper | Multi-step wizards | No |
|
|
77
|
+
| Timeline | Event sequences | No |
|
|
78
|
+
| Rating | Star ratings | No |
|
|
79
|
+
| Upload | File upload zones | No |
|
|
80
|
+
| Spinner | Loading spinners | No |
|
|
81
|
+
| Popover | Rich content tooltips | Yes |
|
|
82
|
+
| Command Palette | Search/command modal | Yes |
|
|
83
|
+
| Datepicker | Date selection calendar | Yes |
|
|
84
|
+
| Timepicker | Time selection | Yes |
|
|
85
|
+
|
|
86
|
+
### Example Components
|
|
87
|
+
|
|
88
|
+
```html
|
|
89
|
+
<!-- Button -->
|
|
90
|
+
<button class="btn btn-primary">Primary</button>
|
|
91
|
+
<button class="btn btn-outline-primary">Outline</button>
|
|
92
|
+
|
|
93
|
+
<!-- Card -->
|
|
94
|
+
<div class="card">
|
|
95
|
+
<div class="card-header">Title</div>
|
|
96
|
+
<div class="card-body">Content</div>
|
|
97
|
+
<div class="card-footer">Footer</div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<!-- Modal -->
|
|
101
|
+
<div class="modal" data-modal id="my-modal">
|
|
102
|
+
<div class="modal-dialog">
|
|
103
|
+
<div class="modal-content">
|
|
104
|
+
<div class="modal-header">
|
|
105
|
+
<h5 class="modal-title">Modal Title</h5>
|
|
106
|
+
<button class="modal-close" data-modal-close>×</button>
|
|
107
|
+
</div>
|
|
108
|
+
<div class="modal-body">Content</div>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
<button data-modal-target="#my-modal">Open Modal</button>
|
|
113
|
+
|
|
114
|
+
<!-- Dropdown -->
|
|
115
|
+
<div class="dropdown" data-dropdown>
|
|
116
|
+
<button class="btn dropdown-toggle">Menu</button>
|
|
117
|
+
<div class="dropdown-menu">
|
|
118
|
+
<a class="dropdown-item" href="#">Action</a>
|
|
119
|
+
<a class="dropdown-item" href="#">Another action</a>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<!-- Accordion -->
|
|
124
|
+
<div class="accordion" data-accordion>
|
|
125
|
+
<div class="accordion-item">
|
|
126
|
+
<button class="accordion-trigger">Section 1</button>
|
|
127
|
+
<div class="accordion-content">
|
|
128
|
+
<div class="accordion-body">Content</div>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Utilities
|
|
135
|
+
|
|
136
|
+
14 utility categories with responsive and state variants:
|
|
137
|
+
|
|
138
|
+
| Category | Example Classes |
|
|
139
|
+
|----------|-----------------|
|
|
140
|
+
| Layout | `flex`, `grid`, `absolute`, `z-10` |
|
|
141
|
+
| Spacing | `p-4`, `mx-auto`, `gap-2` |
|
|
142
|
+
| Typography | `text-lg`, `font-bold`, `leading-tight` |
|
|
143
|
+
| Colors | `text-primary`, `bg-white`, `border-gray-200` |
|
|
144
|
+
| Effects | `shadow-lg`, `rounded-xl`, `opacity-50` |
|
|
145
|
+
| Animations | `transition`, `animate-bounce` |
|
|
146
|
+
| Transforms | `scale-110`, `rotate-45`, `translate-x-4` |
|
|
147
|
+
| Filters | `blur-sm`, `brightness-125`, `grayscale` |
|
|
148
|
+
| Icons | `icon icon-home`, `icon-lg` |
|
|
149
|
+
| Background | `bg-cover`, `bg-center`, `bg-fixed` |
|
|
150
|
+
| Columns | `columns-2`, `column-gap-4` |
|
|
151
|
+
| Scroll | `scroll-smooth`, `snap-x`, `scrollbar-thin` |
|
|
152
|
+
| SVG | `fill-current`, `stroke-primary` |
|
|
153
|
+
| Accessibility | `sr-only`, `focus-ring`, `motion-reduce` |
|
|
154
|
+
|
|
155
|
+
### Responsive Prefixes
|
|
156
|
+
|
|
157
|
+
```html
|
|
158
|
+
<div class="flex flex-col md:flex-row lg:gap-8">
|
|
159
|
+
<!-- Stacked on mobile, row on tablet+ -->
|
|
160
|
+
</div>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
| Prefix | Breakpoint |
|
|
164
|
+
|--------|------------|
|
|
165
|
+
| `sm:` | 640px |
|
|
166
|
+
| `md:` | 768px |
|
|
167
|
+
| `lg:` | 1024px |
|
|
168
|
+
| `xl:` | 1280px |
|
|
169
|
+
| `2xl:` | 1536px |
|
|
170
|
+
|
|
171
|
+
### State Variants
|
|
172
|
+
|
|
173
|
+
```html
|
|
174
|
+
<button class="bg-primary hover:bg-primary-dark focus:ring-2 active:scale-95">
|
|
175
|
+
Interactive
|
|
176
|
+
</button>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
| Prefix | Trigger |
|
|
180
|
+
|--------|---------|
|
|
181
|
+
| `hover:` | Mouse hover |
|
|
182
|
+
| `focus:` | Element focused |
|
|
183
|
+
| `active:` | Being clicked |
|
|
184
|
+
| `disabled:` | Disabled state |
|
|
185
|
+
| `dark:` | Dark mode |
|
|
186
|
+
| `group-hover:` | Parent hovered |
|
|
187
|
+
|
|
188
|
+
## Icons
|
|
189
|
+
|
|
190
|
+
720 built-in icons using CSS masks:
|
|
191
|
+
|
|
192
|
+
```html
|
|
193
|
+
<!-- Basic icon -->
|
|
194
|
+
<span class="icon icon-home"></span>
|
|
195
|
+
|
|
196
|
+
<!-- Sizes -->
|
|
197
|
+
<span class="icon icon-home icon-xs"></span>
|
|
198
|
+
<span class="icon icon-home icon-sm"></span>
|
|
199
|
+
<span class="icon icon-home icon-lg"></span>
|
|
200
|
+
<span class="icon icon-home icon-xl"></span>
|
|
201
|
+
|
|
202
|
+
<!-- Colors -->
|
|
203
|
+
<span class="icon icon-check icon-success"></span>
|
|
204
|
+
<span class="icon icon-x icon-error"></span>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## JavaScript
|
|
208
|
+
|
|
209
|
+
Zero-dependency JavaScript for interactive components:
|
|
210
|
+
|
|
211
|
+
```js
|
|
212
|
+
import Jasmin from 'jasmincss/js';
|
|
213
|
+
|
|
214
|
+
// Auto-initialize all components
|
|
215
|
+
Jasmin.autoInit();
|
|
216
|
+
|
|
217
|
+
// Or initialize specific components
|
|
218
|
+
import { Modal, Dropdown, Tabs } from 'jasmincss/js';
|
|
219
|
+
Modal.initAll();
|
|
220
|
+
Dropdown.initAll();
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Individual Component Control
|
|
224
|
+
|
|
225
|
+
```js
|
|
226
|
+
import { Modal } from 'jasmincss/js';
|
|
227
|
+
|
|
228
|
+
const modal = new Modal(element, {
|
|
229
|
+
backdrop: true,
|
|
230
|
+
keyboard: true,
|
|
231
|
+
focus: true
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
modal.open();
|
|
235
|
+
modal.close();
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Toast Notifications
|
|
239
|
+
|
|
240
|
+
```js
|
|
241
|
+
import { Toast } from 'jasmincss/js';
|
|
242
|
+
|
|
243
|
+
Toast.success('Changes saved!');
|
|
244
|
+
Toast.error('Something went wrong');
|
|
245
|
+
Toast.warning('Please check your input');
|
|
246
|
+
Toast.info('New update available');
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Dark Mode
|
|
250
|
+
|
|
251
|
+
Enable dark mode by adding `class="dark"` to `<html>`:
|
|
252
|
+
|
|
253
|
+
```html
|
|
254
|
+
<html class="dark">
|
|
255
|
+
<body>
|
|
256
|
+
<div class="bg-white dark:bg-gray-900 text-black dark:text-white">
|
|
257
|
+
Adapts to dark mode
|
|
258
|
+
</div>
|
|
259
|
+
</body>
|
|
260
|
+
</html>
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Toggle with JavaScript:
|
|
264
|
+
|
|
265
|
+
```js
|
|
266
|
+
document.documentElement.classList.toggle('dark');
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Or use automatic mode based on system preference:
|
|
270
|
+
|
|
271
|
+
```js
|
|
272
|
+
// jasmin.config.js
|
|
273
|
+
export default {
|
|
274
|
+
darkMode: 'media'
|
|
275
|
+
};
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Configuration
|
|
279
|
+
|
|
280
|
+
Create a `jasmin.config.js` file:
|
|
281
|
+
|
|
282
|
+
```js
|
|
283
|
+
export default {
|
|
284
|
+
// Brand colors
|
|
285
|
+
branding: {
|
|
286
|
+
primary: '#6366f1',
|
|
287
|
+
secondary: '#8b5cf6',
|
|
288
|
+
accent: '#06b6d4'
|
|
289
|
+
},
|
|
290
|
+
|
|
291
|
+
// Content files to scan for tree-shaking
|
|
292
|
+
content: [
|
|
293
|
+
'./src/**/*.{html,js,jsx,ts,tsx,vue}',
|
|
294
|
+
'./index.html'
|
|
295
|
+
],
|
|
296
|
+
|
|
297
|
+
// Dark mode strategy
|
|
298
|
+
darkMode: 'class', // 'class' or 'media'
|
|
299
|
+
|
|
300
|
+
// Breakpoints
|
|
301
|
+
breakpoints: {
|
|
302
|
+
sm: '640px',
|
|
303
|
+
md: '768px',
|
|
304
|
+
lg: '1024px',
|
|
305
|
+
xl: '1280px',
|
|
306
|
+
'2xl': '1536px'
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### CSS Variables
|
|
312
|
+
|
|
313
|
+
Override design tokens directly:
|
|
314
|
+
|
|
315
|
+
```css
|
|
316
|
+
:root {
|
|
317
|
+
--j-primary: #6366f1;
|
|
318
|
+
--j-secondary: #8b5cf6;
|
|
319
|
+
--j-border-radius: 0.5rem;
|
|
320
|
+
--j-font-sans: 'Inter', sans-serif;
|
|
321
|
+
}
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
## CLI Commands
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
# Initialize project with branding wizard
|
|
328
|
+
npx jasmin init
|
|
329
|
+
|
|
330
|
+
# Build CSS
|
|
331
|
+
npx jasmin run dev # Development (full library)
|
|
332
|
+
npx jasmin run build # Production (tree-shaken)
|
|
333
|
+
npx jasmin run watch # Watch mode
|
|
334
|
+
|
|
335
|
+
# Add components
|
|
336
|
+
npx jasmin add modal
|
|
337
|
+
npx jasmin add carousel
|
|
338
|
+
npx jasmin add --list # List all components
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## Framework Integration
|
|
342
|
+
|
|
343
|
+
### Vite
|
|
344
|
+
|
|
345
|
+
```js
|
|
346
|
+
// vite.config.js
|
|
347
|
+
import { jasminPlugin } from 'jasmincss/plugins/vite';
|
|
348
|
+
|
|
349
|
+
export default {
|
|
350
|
+
plugins: [jasminPlugin()]
|
|
351
|
+
};
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Next.js
|
|
355
|
+
|
|
356
|
+
```js
|
|
357
|
+
// next.config.js
|
|
358
|
+
const { withJasmin } = require('jasmincss/plugins/next');
|
|
359
|
+
|
|
360
|
+
module.exports = withJasmin({
|
|
361
|
+
// your config
|
|
362
|
+
});
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
## TypeScript
|
|
366
|
+
|
|
367
|
+
Full type definitions included:
|
|
368
|
+
|
|
369
|
+
```ts
|
|
370
|
+
import Jasmin, { Modal, ModalOptions } from 'jasmincss/js';
|
|
371
|
+
|
|
372
|
+
const options: ModalOptions = {
|
|
373
|
+
backdrop: true,
|
|
374
|
+
keyboard: true
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
const modal = new Modal(element, options);
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
Configuration types:
|
|
381
|
+
|
|
382
|
+
```ts
|
|
383
|
+
import type { JasminConfig } from 'jasmincss/config';
|
|
384
|
+
|
|
385
|
+
const config: JasminConfig = {
|
|
386
|
+
branding: {
|
|
387
|
+
primary: '#6366f1'
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
## VS Code Extension
|
|
393
|
+
|
|
394
|
+
Install the JasminCSS IntelliSense extension for:
|
|
395
|
+
|
|
396
|
+
- Class autocomplete in HTML, JSX, Vue, Svelte
|
|
397
|
+
- Hover documentation showing CSS output
|
|
398
|
+
- Support for responsive and state prefixes
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
cd vscode-extension
|
|
402
|
+
npm install
|
|
403
|
+
npm run build
|
|
404
|
+
npm run package
|
|
405
|
+
code --install-extension jasmincss-intellisense-1.0.0.vsix
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
## Example Templates
|
|
409
|
+
|
|
410
|
+
Ready-to-use templates in `/examples`:
|
|
411
|
+
|
|
412
|
+
| Template | Description |
|
|
413
|
+
|----------|-------------|
|
|
414
|
+
| `landing/` | SaaS landing page with hero, pricing, FAQ |
|
|
415
|
+
| `dashboard/` | Admin dashboard with sidebar, tables, stats |
|
|
416
|
+
| `blog/` | Blog with article cards, categories, newsletter |
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
# Serve examples locally
|
|
420
|
+
npx serve .
|
|
421
|
+
open http://localhost:3000/examples/landing/
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
## Testing
|
|
425
|
+
|
|
426
|
+
```bash
|
|
427
|
+
# Unit tests
|
|
428
|
+
npm test
|
|
429
|
+
|
|
430
|
+
# Browser tests (Playwright)
|
|
431
|
+
npm run test:browser
|
|
432
|
+
|
|
433
|
+
# Accessibility tests
|
|
434
|
+
npm run test:a11y
|
|
435
|
+
|
|
436
|
+
# Performance benchmark
|
|
437
|
+
npm run test:perf
|
|
438
|
+
|
|
439
|
+
# Run all tests
|
|
440
|
+
npm run test:all
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
## Accessibility
|
|
444
|
+
|
|
445
|
+
JasminCSS components include:
|
|
446
|
+
|
|
447
|
+
- Proper ARIA attributes
|
|
448
|
+
- Keyboard navigation
|
|
449
|
+
- Focus management
|
|
450
|
+
- Screen reader support
|
|
451
|
+
- Reduced motion support
|
|
452
|
+
|
|
453
|
+
Utilities for accessibility:
|
|
454
|
+
|
|
455
|
+
```html
|
|
456
|
+
<!-- Screen reader only -->
|
|
457
|
+
<span class="sr-only">Hidden text for screen readers</span>
|
|
458
|
+
|
|
459
|
+
<!-- Focus ring -->
|
|
460
|
+
<button class="focus-ring">Visible focus</button>
|
|
461
|
+
|
|
462
|
+
<!-- Skip link -->
|
|
463
|
+
<a href="#main" class="sr-only-focusable">Skip to content</a>
|
|
464
|
+
|
|
465
|
+
<!-- Reduced motion -->
|
|
466
|
+
<div class="motion-safe:animate-bounce motion-reduce:animate-none">
|
|
467
|
+
Respects user preferences
|
|
468
|
+
</div>
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
## Browser Support
|
|
472
|
+
|
|
473
|
+
- Chrome 90+
|
|
474
|
+
- Firefox 90+
|
|
475
|
+
- Safari 15+
|
|
476
|
+
- Edge 90+
|
|
477
|
+
|
|
478
|
+
## Project Structure
|
|
479
|
+
|
|
480
|
+
```
|
|
481
|
+
jasmincss/
|
|
482
|
+
├── dist/ # Compiled CSS
|
|
483
|
+
├── src/
|
|
484
|
+
│ ├── core/
|
|
485
|
+
│ │ ├── utilities/ # 14 utility modules
|
|
486
|
+
│ │ └── base/ # Reset and variables
|
|
487
|
+
│ ├── components/ # 26 component styles
|
|
488
|
+
│ └── js/
|
|
489
|
+
│ ├── components/ # Interactive behaviors
|
|
490
|
+
│ └── types/ # TypeScript definitions
|
|
491
|
+
├── docs/ # Documentation
|
|
492
|
+
├── examples/ # Template examples
|
|
493
|
+
├── tests/ # Browser, perf, a11y tests
|
|
494
|
+
├── vscode-extension/ # VS Code IntelliSense
|
|
495
|
+
└── bin/ # CLI tool
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
## Contributing
|
|
499
|
+
|
|
500
|
+
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
|
|
501
|
+
|
|
502
|
+
```bash
|
|
503
|
+
# Clone the repo
|
|
504
|
+
git clone https://github.com/jasmaine/JasminCSS.git
|
|
505
|
+
|
|
506
|
+
# Install dependencies
|
|
507
|
+
npm install
|
|
508
|
+
|
|
509
|
+
# Run development build
|
|
510
|
+
npm run dev
|
|
511
|
+
|
|
512
|
+
# Run tests
|
|
513
|
+
npm run test:all
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
## License
|
|
517
|
+
|
|
518
|
+
MIT License - free for personal and commercial use.
|
|
519
|
+
|
|
520
|
+
---
|
|
521
|
+
|
|
522
|
+
**Documentation:** [docs/](./docs/)
|
|
523
|
+
**Examples:** [examples/](./examples/)
|
|
524
|
+
**Issues:** [GitHub Issues](https://github.com/jasmaine/JasminCSS/issues)
|
package/bin/jasmin.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
import pc from 'picocolors';
|
|
5
|
+
import { initCommand } from '../src/cli/init.js';
|
|
6
|
+
import { runCommand } from '../src/cli/run.js';
|
|
7
|
+
import { addCommand } from '../src/cli/add.js';
|
|
8
|
+
|
|
9
|
+
const program = new Command();
|
|
10
|
+
|
|
11
|
+
console.log(pc.magenta(`
|
|
12
|
+
╦╔═╗╔═╗╔╦╗╦╔╗╔ ╔═╗╔═╗╔═╗
|
|
13
|
+
║╠═╣╚═╗║║║║║║║ ║ ╚═╗╚═╗
|
|
14
|
+
╚╝╩ ╩╚═╝╩ ╩╩╝╚╝ ╚═╝╚═╝╚═╝
|
|
15
|
+
`));
|
|
16
|
+
console.log(pc.dim(' Modern CSS Framework v1.0.0\n'));
|
|
17
|
+
|
|
18
|
+
program
|
|
19
|
+
.name('jasmin')
|
|
20
|
+
.description('JasminCSS - A modern, future-proof CSS framework')
|
|
21
|
+
.version('1.0.0');
|
|
22
|
+
|
|
23
|
+
program
|
|
24
|
+
.command('init')
|
|
25
|
+
.description('Initialize JasminCSS in your project with branding setup')
|
|
26
|
+
.option('-y, --yes', 'Skip prompts and use defaults')
|
|
27
|
+
.option('-t, --template <name>', 'Use a predefined template (minimal, corporate, creative, futuristic)')
|
|
28
|
+
.action(initCommand);
|
|
29
|
+
|
|
30
|
+
program
|
|
31
|
+
.command('run <task>')
|
|
32
|
+
.description('Run a JasminCSS task (build, dev, watch)')
|
|
33
|
+
.option('-c, --config <path>', 'Path to jasmin.config.js', 'jasmin.config.js')
|
|
34
|
+
.option('-o, --output <path>', 'Output directory', 'dist')
|
|
35
|
+
.option('--minify', 'Minify output (default for build)')
|
|
36
|
+
.option('--no-minify', 'Skip minification')
|
|
37
|
+
.action(runCommand);
|
|
38
|
+
|
|
39
|
+
program
|
|
40
|
+
.command('add <component>')
|
|
41
|
+
.description('Add a component to your project')
|
|
42
|
+
.option('--list', 'List all available components')
|
|
43
|
+
.action(addCommand);
|
|
44
|
+
|
|
45
|
+
program.parse();
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Type definitions for JasminCSS
|
|
2
|
+
export interface JasminConfig {
|
|
3
|
+
projectName?: string;
|
|
4
|
+
darkMode?: boolean;
|
|
5
|
+
prefix?: string;
|
|
6
|
+
content?: string[];
|
|
7
|
+
branding?: BrandingConfig;
|
|
8
|
+
components?: string[];
|
|
9
|
+
utilities?: string[];
|
|
10
|
+
colors?: Record<string, Record<string, string>>;
|
|
11
|
+
spacing?: Record<string, string>;
|
|
12
|
+
breakpoints?: Record<string, string>;
|
|
13
|
+
animation?: AnimationConfig;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface BrandingConfig {
|
|
17
|
+
colors?: {
|
|
18
|
+
primary?: string;
|
|
19
|
+
secondary?: string;
|
|
20
|
+
accent?: string;
|
|
21
|
+
success?: string;
|
|
22
|
+
warning?: string;
|
|
23
|
+
error?: string;
|
|
24
|
+
info?: string;
|
|
25
|
+
};
|
|
26
|
+
typography?: {
|
|
27
|
+
fontFamily?: string;
|
|
28
|
+
fontFamilyMono?: string;
|
|
29
|
+
baseFontSize?: string;
|
|
30
|
+
lineHeight?: number;
|
|
31
|
+
};
|
|
32
|
+
borderRadius?: Record<string, string>;
|
|
33
|
+
shadows?: Record<string, string>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface AnimationConfig {
|
|
37
|
+
duration?: Record<string, string>;
|
|
38
|
+
easing?: Record<string, string>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface CompileOptions {
|
|
42
|
+
usedClasses?: Set<string>;
|
|
43
|
+
minify?: boolean;
|
|
44
|
+
includeAll?: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface CompileResult {
|
|
48
|
+
css: string;
|
|
49
|
+
minified?: string;
|
|
50
|
+
stats: {
|
|
51
|
+
utilities: number;
|
|
52
|
+
components: number;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function compileCSS(config: JasminConfig, options?: CompileOptions): Promise<CompileResult>;
|
|
57
|
+
export function scanForUsedClasses(cwd: string, patterns: string[]): Promise<Set<string>>;
|
|
58
|
+
export function loadConfig(configPath: string): Promise<JasminConfig>;
|
|
59
|
+
export function resolveConfig(config: JasminConfig): JasminConfig;
|
|
60
|
+
|
|
61
|
+
export const defaultConfig: JasminConfig;
|
|
62
|
+
export const templates: Record<string, Partial<JasminConfig>>;
|