chaincss 2.1.31 → 2.1.32
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 +28 -33
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<h1 align="center"
|
|
1
|
+
<h1 align="center">ChainCSS</h1>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<strong>The first CSS-in-JS library with true auto-detection mixed mode.</strong><br>
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
</a>
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
|
-
---
|
|
24
23
|
|
|
25
24
|
# What is ChainCSS?
|
|
26
25
|
|
|
@@ -47,7 +46,6 @@ const card = chain()
|
|
|
47
46
|
|
|
48
47
|
**No CSS syntax. No template literals. No object literals. Just JavaScript.**
|
|
49
48
|
|
|
50
|
-
---
|
|
51
49
|
|
|
52
50
|
# Installation
|
|
53
51
|
|
|
@@ -64,6 +62,7 @@ npm install chaincss
|
|
|
64
62
|
| **Browser CDN** | `import { chain } from "https://cdn.jsdelivr.net/npm/chaincss/dist/browser.js"` |
|
|
65
63
|
| **Browser + import map** | Map `"chaincss"` to `./node_modules/chaincss/dist/browser.js` |
|
|
66
64
|
|
|
65
|
+
|
|
67
66
|
## Vite Configuration
|
|
68
67
|
|
|
69
68
|
```ts
|
|
@@ -76,7 +75,6 @@ export default defineConfig({
|
|
|
76
75
|
});
|
|
77
76
|
```
|
|
78
77
|
|
|
79
|
-
---
|
|
80
78
|
|
|
81
79
|
# Core API
|
|
82
80
|
|
|
@@ -121,7 +119,6 @@ const heading = chain()
|
|
|
121
119
|
injectChainStyles({ heading });
|
|
122
120
|
```
|
|
123
121
|
|
|
124
|
-
---
|
|
125
122
|
|
|
126
123
|
# Feature Reference
|
|
127
124
|
|
|
@@ -145,6 +142,7 @@ chain()
|
|
|
145
142
|
.pos("relative");
|
|
146
143
|
```
|
|
147
144
|
|
|
145
|
+
|
|
148
146
|
## Macros (57)
|
|
149
147
|
|
|
150
148
|
### Layout & Display
|
|
@@ -292,7 +290,7 @@ chain()
|
|
|
292
290
|
.$el("responsive");
|
|
293
291
|
```
|
|
294
292
|
|
|
295
|
-
**Built-in breakpoints:** `sm`, `md`, `lg`, `xl`, `2xl`, `mobile`, `tablet`, `desktop`, `portrait`, `landscape`, `dark`, `light`, `reducedMotion`, `highContrast`, `print`, `hover`, `no-hover`, `fine`, `coarse`
|
|
293
|
+
**Built-in breakpoints (20):** `sm`, `md`, `lg`, `xl`, `2xl`, `mobile`, `tablet`, `desktop`, `portrait`, `landscape`, `dark`, `light`, `reducedMotion`, `highContrast`, `print`, `hover`, `no-hover`, `fine`, `coarse`
|
|
296
294
|
|
|
297
295
|
## Transform Methods
|
|
298
296
|
|
|
@@ -306,7 +304,7 @@ chain()
|
|
|
306
304
|
.$el("transformed");
|
|
307
305
|
```
|
|
308
306
|
|
|
309
|
-
### Math Helpers
|
|
307
|
+
### Math Helpers (15)
|
|
310
308
|
|
|
311
309
|
```ts
|
|
312
310
|
chain()
|
|
@@ -358,22 +356,33 @@ const theme = new Theme(light);
|
|
|
358
356
|
theme.toCSSVariables("my-theme"); // -> :root { --my-theme-colors-primary: #3b82f6; ... }
|
|
359
357
|
```
|
|
360
358
|
|
|
361
|
-
## Recipe System
|
|
359
|
+
## Recipe System (Variants)
|
|
362
360
|
|
|
363
361
|
```ts
|
|
364
362
|
import { recipe } from "chaincss";
|
|
365
363
|
|
|
366
364
|
const button = recipe({
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
365
|
+
base: { selectors: ["btn"], display: "inline-flex", borderRadius: "8px", fontWeight: 600 },
|
|
366
|
+
variants: {
|
|
367
|
+
size: {
|
|
368
|
+
sm: { padding: "8px 16px", fontSize: "14px" },
|
|
369
|
+
lg: { padding: "16px 32px", fontSize: "18px" },
|
|
370
|
+
},
|
|
371
|
+
color: {
|
|
372
|
+
primary: { background: "#3b82f6", color: "white" },
|
|
373
|
+
danger: { background: "#ef4444", color: "white" },
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
defaultVariants: { size: "md", color: "primary" },
|
|
377
|
+
compoundVariants: [
|
|
378
|
+
{ variants: { size: "lg", color: "primary" }, style: { fontWeight: 800 } },
|
|
379
|
+
],
|
|
373
380
|
});
|
|
381
|
+
|
|
382
|
+
const styles = button({ size: "lg", color: "danger" });
|
|
374
383
|
```
|
|
375
384
|
|
|
376
|
-
### Animations
|
|
385
|
+
### Animations (42 presets)
|
|
377
386
|
|
|
378
387
|
```ts
|
|
379
388
|
chain().fadeIn().$el("el"); chain().slideInUp().$el("el"); chain().slideInUp().$el("el");
|
|
@@ -409,7 +418,6 @@ const diff = getStyleDiff(snapshotId1, snapshotId2);
|
|
|
409
418
|
// -> { added: {...}, removed: {...}, modified: {...} }
|
|
410
419
|
```
|
|
411
420
|
|
|
412
|
-
---
|
|
413
421
|
|
|
414
422
|
# CLI
|
|
415
423
|
|
|
@@ -422,7 +430,6 @@ chaincss cache stats
|
|
|
422
430
|
chaincss timeline list
|
|
423
431
|
```
|
|
424
432
|
|
|
425
|
-
---
|
|
426
433
|
|
|
427
434
|
# Configuration
|
|
428
435
|
|
|
@@ -455,7 +462,6 @@ export default {
|
|
|
455
462
|
};
|
|
456
463
|
```
|
|
457
464
|
|
|
458
|
-
---
|
|
459
465
|
|
|
460
466
|
# Framework Integration
|
|
461
467
|
|
|
@@ -484,11 +490,8 @@ function Card() {
|
|
|
484
490
|
```ts
|
|
485
491
|
import { chain } from "chaincss";
|
|
486
492
|
|
|
487
|
-
const styles = chain()
|
|
488
|
-
|
|
489
|
-
.cols(3)
|
|
490
|
-
.gap(16)
|
|
491
|
-
.$el("grid");
|
|
493
|
+
const styles = chain().display("grid").cols(3).gap(16).$el("grid");
|
|
494
|
+
// <div :class="styles.selectors[0]">
|
|
492
495
|
```
|
|
493
496
|
|
|
494
497
|
## Svelte
|
|
@@ -496,10 +499,8 @@ const styles = chain()
|
|
|
496
499
|
```ts
|
|
497
500
|
import { chain } from "chaincss";
|
|
498
501
|
|
|
499
|
-
const styles = chain()
|
|
500
|
-
|
|
501
|
-
.center()
|
|
502
|
-
.$el("centered");
|
|
502
|
+
const styles = chain().flex().center().$el("centered");
|
|
503
|
+
// <div class={styles.selectors[0]}>
|
|
503
504
|
```
|
|
504
505
|
|
|
505
506
|
### Vanilla JS
|
|
@@ -519,7 +520,6 @@ const styles = chain()
|
|
|
519
520
|
</script>
|
|
520
521
|
```
|
|
521
522
|
|
|
522
|
-
---
|
|
523
523
|
|
|
524
524
|
## Complete Feature List
|
|
525
525
|
|
|
@@ -541,9 +541,6 @@ const styles = chain()
|
|
|
541
541
|
| Dev Tools | 3 | Suggestions Engine, Timeline, Component Generator |
|
|
542
542
|
| Tests | 258 | 18 test files, 0 failures |
|
|
543
543
|
|
|
544
|
-
---
|
|
545
|
-
|
|
546
|
-
---
|
|
547
544
|
|
|
548
545
|
# Performance
|
|
549
546
|
|
|
@@ -553,7 +550,6 @@ const styles = chain()
|
|
|
553
550
|
- LRU persistent caching
|
|
554
551
|
- Shared property deduplication
|
|
555
552
|
|
|
556
|
-
---
|
|
557
553
|
|
|
558
554
|
# Contributing
|
|
559
555
|
|
|
@@ -567,7 +563,6 @@ npm install
|
|
|
567
563
|
npm test
|
|
568
564
|
```
|
|
569
565
|
|
|
570
|
-
---
|
|
571
566
|
|
|
572
567
|
# License
|
|
573
568
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chaincss",
|
|
3
|
-
"version": "2.1.
|
|
4
|
-
"description": "ChainCSS
|
|
3
|
+
"version": "2.1.32",
|
|
4
|
+
"description": "ChainCSS - The first CSS-in-JS library with true auto-detection mixed mode. Zero runtime by default, dynamic when you need it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|