@invana/styling 0.0.29 → 0.0.30

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.css +44 -48
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invana/styling",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "Invana TailwindCSS 4 Design System - Reusable styling configuration",
5
5
  "homepage": "https://github.com/invana/design-kit#readme",
6
6
  "type": "module",
package/src/index.css CHANGED
@@ -17,17 +17,18 @@
17
17
  /*
18
18
  * The type ladder.
19
19
  *
20
- * TWO content sizes, and a root that is the only dial.
20
+ * THREE content sizes, and a root that is the only dial.
21
21
  *
22
22
  * base 1rem the size of everything, by default
23
- * meta 0.923rem the one step under it
23
+ * sm 0.923rem one step under it
24
+ * xs 0.846rem two steps under it — genuinely small
24
25
  *
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
26
+ * `html` below is 13px, so that reads 13 / 12 / 11 in an application. A
27
+ * marketing page setting a 16px root gets 16 / 14.8 / 13.5 from the same
27
28
  * components — which is the point: every step here is a ratio of the root, so
28
29
  * the root is what moves, not 49 class names.
29
30
  *
30
- * ── Why `sm` and `xs` are aliases, not rungs ──────────────────────────────
31
+ * ── Why `sm` and `xs` are the rungs, and `meta` is gone ──────────────────
31
32
  *
32
33
  * A block declaring `--font-size-*` used to live here. Tailwind v4's type
33
34
  * namespace is `--text-*`, so none of it generated a utility and `text-xs`,
@@ -36,68 +37,63 @@
36
37
  * get when shadcn's ladder — authored for a 16px root, where `text-sm` means
37
38
  * "the UI size" — is dropped onto a 13px one.
38
39
  *
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.
40
+ * The first fix re-pointed them as **aliases**: `sm` onto `base` and `xs`
41
+ * onto a third token, `meta`. That kept 300+ call sites rendering what their
42
+ * authors meant, and it is why this file used to carry four names. But four
43
+ * names over two sizes is a ladder nobody can read — `text-sm` rendering the
44
+ * same pixels as `text-base` is the opposite of what every developer assumes,
45
+ * and `text-xs` being a duplicate of `meta` made the choice between them
46
+ * arbitrary. The sizes then looked inconsistent wherever both appeared,
47
+ * because the one real step was a single pixel deep.
44
48
  *
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.
49
+ * So `meta` is deleted and the built-in names carry the scale: **base, sm,
50
+ * xs**, three rungs, each meaning what it reads as. The migration was a 1:1
51
+ * rename — `text-sm → text-base`, then `text-meta → text-sm` and
52
+ * `text-xs → text-sm` — so not a pixel moved, and `xs` became a rung that was
53
+ * never available before.
56
54
  *
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.
55
+ * Default text still declares **no size at all** and inherits the root. `sm`
56
+ * is for text that is deliberately subordinate — a count, a timing, a row's
57
+ * subtitle. `xs` is for the genuinely small, and is rare.
61
58
  *
62
59
  * `lg`, `xl` and up keep Tailwind's defaults: they are heading steps, nothing
63
60
  * complained about them, and moving them would re-baseline every title in the
64
61
  * system for no stated reason.
65
62
  *
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.)
63
+ * Every name here is a Tailwind built-in, so nothing needs registering in a
64
+ * `font-size` class group any more — the `extendTailwindMerge` block that
65
+ * existed only to register `meta` is gone with it, and so is the footgun
66
+ * where an unregistered `text-*` size was read as a colour and silently
67
+ * dropped the colour class before it.
68
+ *
69
+ * One catch remains, and it is not obvious. A consumer importing the
70
+ * PRECOMPILED `@invana/ui/styles.css` gets plain `:root{--text-…}` custom
71
+ * properties, not theme tokens, and Tailwind emits a utility only for a class
72
+ * something uses. For these values to reach a consumer, that consumer must
73
+ * `@import "@invana/styling"` so this block is in its source graph. Studio
74
+ * does (`studio/src/index.css`).
71
75
  */
72
76
 
73
77
  /*
74
- * The meta step — the one size under the base.
78
+ * The two steps under the base.
75
79
  *
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.
80
+ * Stated as ratios of the root rather than absolute px: a px step cannot
81
+ * follow a root that moves, and following the root is what lets these
82
+ * components render a website as well as an application. At the 13px `html`
83
+ * below that reads 13 / 12 / 11; a 16px marketing root reads 16 / 14.8 / 13.5
84
+ * from the same class names.
81
85
  *
82
86
  * `rem`, not `em`: nested subordinate text should not compound down to 11px
83
87
  * 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
88
  *
91
89
  * The paired `--line-height` matters as much as the size. Tailwind ships one
92
90
  * 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.
91
+ * classes rendering the same text in rows of different heights — the same
92
+ * inconsistency one level down. Both take the base ratio.
97
93
  */
98
- --text-sm: 1rem;
94
+ --text-sm: 0.923rem;
99
95
  --text-sm--line-height: 1.5;
100
- --text-xs: 0.923rem;
96
+ --text-xs: 0.846rem;
101
97
  --text-xs--line-height: 1.5;
102
98
 
103
99
  /* Font weights */