cursedbelt 2.3.0 → 2.5.1
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/dist/styles-static.css +41 -19
- package/dist/styles-utilities.css +5074 -0
- package/dist/styles.css +41 -19
- package/package.json +13 -3
- package/scripts/generateUtilityStyles.ts +215 -0
- package/src/styles-static.css +41 -19
- package/src/styles-utilities.css +5074 -0
- package/src/styles.css +41 -19
- package/src/stylesUtilitiesMatches.spec.ts +314 -0
package/dist/styles-static.css
CHANGED
|
@@ -6,32 +6,54 @@
|
|
|
6
6
|
* This `@source` makes Tailwind v4 scan cursedbelt's source files so the utility
|
|
7
7
|
* classes used by its components are generated in the app's stylesheet.
|
|
8
8
|
*
|
|
9
|
-
* ── Two
|
|
9
|
+
* ── Two ways in, and which one an app wants ──────────────────────────────────
|
|
10
10
|
* `@source "."` is the expensive half: it points Tailwind's JIT at cursedbelt's
|
|
11
11
|
* ENTIRE source tree, so the app emits the union of the whole design system
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* whether it renders three components or eighty, and its own build walks 827
|
|
13
|
+
* files it does not own. Everything else in this file is CSS the components
|
|
14
|
+
* genuinely need and no app can do without.
|
|
15
15
|
*
|
|
16
|
-
* A CSS `@import` takes the whole file, so the split is
|
|
16
|
+
* A CSS `@import` takes the whole file, so the split is two more subpaths:
|
|
17
17
|
*
|
|
18
|
-
* cursedbelt/styles.css
|
|
19
|
-
* cursedbelt/styles-static.css
|
|
18
|
+
* cursedbelt/styles.css this file — the real CSS + the `@source` scan
|
|
19
|
+
* cursedbelt/styles-static.css the same file MINUS the `@source` line
|
|
20
|
+
* cursedbelt/styles-utilities.css the utilities that `@source` line would have
|
|
21
|
+
* produced, precompiled at cursedbelt's build
|
|
20
22
|
*
|
|
21
|
-
* The
|
|
22
|
-
* tooltip pointer-events fix, the Progress keyframes, the
|
|
23
|
-
* ambient/glass layer and `tw-animate-css`, and emits none
|
|
24
|
-
* utility classes,
|
|
25
|
-
* sources IT registers. Do not hand-list cursedbelt's component files to get
|
|
26
|
-
* them back: a relative `@source` reaching into this package's source tree is a
|
|
27
|
-
* `file:` dependency wearing a stylesheet's clothes, and it is the thing the
|
|
28
|
-
* previous generation's 29-line-per-app arrangement is remembered for.
|
|
23
|
+
* The second two are a PAIR and neither is usable alone — `styles-static.css` on
|
|
24
|
+
* its own gets the tooltip pointer-events fix, the Progress keyframes, the
|
|
25
|
+
* lightbox bridge, the ambient/glass layer and `tw-animate-css`, and emits none
|
|
26
|
+
* of cursedbelt's utility classes, i.e. an unstyled app:
|
|
29
27
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
28
|
+
* @import "tailwindcss";
|
|
29
|
+
* @import "cursedbelt/styles-static.css";
|
|
30
|
+
* @import "cursedbelt/styles-utilities.css";
|
|
31
|
+
* @import "cursedbelt/theme.css";
|
|
32
|
+
*
|
|
33
|
+
* 🔴 Do NOT hand-list cursedbelt's component files to get the utilities back.
|
|
34
|
+
* Tailwind v4 resolves every `@source` to a DIRECTORY and scans it recursively —
|
|
35
|
+
* a file path and a glob are both silently widened to their parent — and
|
|
36
|
+
* `VirtualList`/`VirtualCardGrid` live at the root of `src/react/`, so the finest
|
|
37
|
+
* grain an app can write is the whole design system. A relative `@source` reaching
|
|
38
|
+
* into this package's source tree is also a `file:` dependency wearing a
|
|
39
|
+
* stylesheet's clothes, and it buys nothing: it is the thing the previous
|
|
40
|
+
* generation's 29-line-per-app arrangement is remembered for, and those 29 lines
|
|
41
|
+
* were never file-level scoping either.
|
|
42
|
+
*
|
|
43
|
+
* The pair is not SMALLER than this file — measured, both routes emit the same
|
|
44
|
+
* rules within 54 bytes. What it buys is a build that scans nothing of another
|
|
45
|
+
* package's source tree, and a `styles-static.css` that finally has a correct
|
|
46
|
+
* use. The measurements, and what would actually shrink a consumer, are in the
|
|
47
|
+
* header of `scripts/generateUtilityStyles.ts`.
|
|
48
|
+
*
|
|
49
|
+
* 🔴 This header is in BOTH of the first two files, because one is generated from
|
|
50
|
+
* the other and a test holds them byte-identical apart from the `@source` line.
|
|
51
|
+
* Always edit `src/styles.css`; never `src/styles-static.css`, which
|
|
33
52
|
* `scripts/generateStaticStyles.ts` rewrites on every `bun run build` and
|
|
34
|
-
* `src/stylesStaticMatches.spec.ts` fails on when it is stale.
|
|
53
|
+
* `src/stylesStaticMatches.spec.ts` fails on when it is stale. Editing this file
|
|
54
|
+
* invalidates `src/styles-utilities.css` too — it is compiled against the static
|
|
55
|
+
* variant, `scripts/generateUtilityStyles.ts` rewrites it in the same build step,
|
|
56
|
+
* and `src/stylesUtilitiesMatches.spec.ts` is what fails when it is stale.
|
|
35
57
|
*/
|
|
36
58
|
|
|
37
59
|
/* Animation utilities (animate-in/out, fade/zoom/slide-in-from-*) consumed by the
|