@invana/styling 0.0.21 → 0.0.22
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/package.json +1 -1
- package/src/index.css +103 -12
package/package.json
CHANGED
package/src/index.css
CHANGED
|
@@ -14,18 +14,91 @@
|
|
|
14
14
|
--container-padding: 2rem;
|
|
15
15
|
--container-screens-2xl: 1400px;
|
|
16
16
|
|
|
17
|
-
/*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
/*
|
|
18
|
+
* The type ladder.
|
|
19
|
+
*
|
|
20
|
+
* TWO content sizes, and a root that is the only dial.
|
|
21
|
+
*
|
|
22
|
+
* base 1rem the size of everything, by default
|
|
23
|
+
* meta 0.923rem the one step under it
|
|
24
|
+
*
|
|
25
|
+
* `html` below is 13px, so that reads 13px / 12px in an application. A
|
|
26
|
+
* marketing page setting a 16px root gets 16px / 14.8px from the same
|
|
27
|
+
* components — which is the point: every step here is a ratio of the root, so
|
|
28
|
+
* the root is what moves, not 49 class names.
|
|
29
|
+
*
|
|
30
|
+
* ── Why `sm` and `xs` are aliases, not rungs ──────────────────────────────
|
|
31
|
+
*
|
|
32
|
+
* A block declaring `--font-size-*` used to live here. Tailwind v4's type
|
|
33
|
+
* namespace is `--text-*`, so none of it generated a utility and `text-xs`,
|
|
34
|
+
* `text-sm` and friends silently resolved to Tailwind's rem defaults against
|
|
35
|
+
* a 13px root: xs 9.75px, sm 11.375px. Nobody chose those. They are what you
|
|
36
|
+
* get when shadcn's ladder — authored for a 16px root, where `text-sm` means
|
|
37
|
+
* "the UI size" — is dropped onto a 13px one.
|
|
38
|
+
*
|
|
39
|
+
* They are re-pointed rather than deleted because 300+ call sites across
|
|
40
|
+
* design-kit, canvas and invana already say `text-sm` meaning "normal UI
|
|
41
|
+
* text" and `text-xs` meaning "a step down". That is exactly `base` and
|
|
42
|
+
* `meta`, so the classes render what their authors meant — but ONLY in a
|
|
43
|
+
* build that has this @theme block in its source graph.
|
|
44
|
+
*
|
|
45
|
+
* That is the catch, and it is not obvious. A consumer importing the
|
|
46
|
+
* PRECOMPILED `@invana/ui/styles.css` gets plain `:root{--text-…}` custom
|
|
47
|
+
* properties, not theme tokens — and Tailwind emits a utility only for a
|
|
48
|
+
* class something uses, so `.text-sm` is not in that file at all now that no
|
|
49
|
+
* kit component writes it. Such a consumer's own Tailwind therefore generates
|
|
50
|
+
* `.text-sm` from ITS default (0.875rem) and lands back on 11.375px.
|
|
51
|
+
*
|
|
52
|
+
* For the aliases to reach a consumer, that consumer must
|
|
53
|
+
* `@import "@invana/styling"` (or `@invana/styling/index.css`) so this block
|
|
54
|
+
* is compiled as part of their build. Studio imports only the prebuilt
|
|
55
|
+
* `@invana/ui/styles.css` today, so it does NOT yet pick these up.
|
|
56
|
+
*
|
|
57
|
+
* New code should not reach for them. Default text declares no size at all
|
|
58
|
+
* and inherits the root; text that is deliberately subordinate — a count, a
|
|
59
|
+
* timing, a row's subtitle — says `text-meta`, which names the job. `sm` and
|
|
60
|
+
* `xs` are here so old code is correct, not so new code has options.
|
|
61
|
+
*
|
|
62
|
+
* `lg`, `xl` and up keep Tailwind's defaults: they are heading steps, nothing
|
|
63
|
+
* complained about them, and moving them would re-baseline every title in the
|
|
64
|
+
* system for no stated reason.
|
|
65
|
+
*
|
|
66
|
+
* When adding any `--text-*` token, register it in the `font-size` class
|
|
67
|
+
* group in `@invana/ui`'s `cn` as well. `text-*` is both the size and the
|
|
68
|
+
* colour scale, so tailwind-merge reads a size it does not recognise as a
|
|
69
|
+
* colour and silently strips the real colour class. (`xs` and `sm` are
|
|
70
|
+
* built-ins and already in that group; `meta` is registered.)
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
* The meta step — the one size under the base.
|
|
75
|
+
*
|
|
76
|
+
* Stated as a ratio of the root (12/13) rather than the absolute `12px` it
|
|
77
|
+
* used to be. Absolute was the right call while the ladder around it was
|
|
78
|
+
* broken; it is the wrong one now, because a px step cannot follow a root
|
|
79
|
+
* that moves, and following the root is what lets these components render a
|
|
80
|
+
* website as well as an application.
|
|
81
|
+
*
|
|
82
|
+
* `rem`, not `em`: nested subordinate text should not compound down to 11px
|
|
83
|
+
* and then 10px. One step means one step, wherever it sits.
|
|
84
|
+
*/
|
|
85
|
+
--text-meta: 0.923rem;
|
|
86
|
+
--text-meta--line-height: 1.5;
|
|
87
|
+
|
|
88
|
+
/*
|
|
89
|
+
* Compatibility aliases — see the ladder note above. Not for new code.
|
|
90
|
+
*
|
|
91
|
+
* The paired `--line-height` matters as much as the size. Tailwind ships one
|
|
92
|
+
* per step (sm 1.4286, xs 1.3333), and re-pointing only the size leaves two
|
|
93
|
+
* classes rendering 12px text in rows of different heights — the same
|
|
94
|
+
* inconsistency one level down. Both aliases take the base ratio, so
|
|
95
|
+
* `text-xs` and `text-meta` are the same line, and `text-sm` and `text-base`
|
|
96
|
+
* are the same line.
|
|
97
|
+
*/
|
|
98
|
+
--text-sm: 1rem;
|
|
99
|
+
--text-sm--line-height: 1.5;
|
|
100
|
+
--text-xs: 0.923rem;
|
|
101
|
+
--text-xs--line-height: 1.5;
|
|
29
102
|
|
|
30
103
|
/* Font weights */
|
|
31
104
|
--font-weight-regular: 400;
|
|
@@ -72,6 +145,12 @@
|
|
|
72
145
|
--color-card: hsl(0 0% 100%);
|
|
73
146
|
--color-card-foreground: hsl(210 10% 20%);
|
|
74
147
|
|
|
148
|
+
/* The line between two things on a canvas — a graph edge, a dependency
|
|
149
|
+
arrow, a connector. Deliberately NOT --color-border: a border separates
|
|
150
|
+
surfaces and may go invisible against them, while an edge is content and
|
|
151
|
+
has to stay legible on the canvas it is drawn on. */
|
|
152
|
+
--color-edge: hsl(210 6% 78%);
|
|
153
|
+
|
|
75
154
|
/* ------------------------------------------------------------------------
|
|
76
155
|
* Border radius — the design language, decided 01-09-2026.
|
|
77
156
|
*
|
|
@@ -163,6 +242,18 @@
|
|
|
163
242
|
--glass-blur: none; /* no backdrop blur */
|
|
164
243
|
}
|
|
165
244
|
|
|
245
|
+
/*
|
|
246
|
+
* Dark: the edge lifts, because the surface it is drawn on went dark. One rule
|
|
247
|
+
* for every dark theme, whatever its brand accent — an edge is content, and
|
|
248
|
+
* content does not change colour when the shell does (same reasoning as
|
|
249
|
+
* themes/data-palette.css). The suffix selector also catches a theme added
|
|
250
|
+
* after this was written.
|
|
251
|
+
*/
|
|
252
|
+
[data-theme$="-dark"],
|
|
253
|
+
.dark {
|
|
254
|
+
--color-edge: hsl(210 6% 30%);
|
|
255
|
+
}
|
|
256
|
+
|
|
166
257
|
[data-glass="true"] {
|
|
167
258
|
--surface-alpha: 0.6;
|
|
168
259
|
--glass-blur: blur(12px);
|