@invana/styling 0.0.29 → 0.0.31
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 +44 -48
package/package.json
CHANGED
package/src/index.css
CHANGED
|
@@ -17,17 +17,18 @@
|
|
|
17
17
|
/*
|
|
18
18
|
* The type ladder.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
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
|
-
*
|
|
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
|
|
26
|
-
* marketing page setting a 16px root gets
|
|
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
|
|
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
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
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
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
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
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
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
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
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
|
|
78
|
+
* The two steps under the base.
|
|
75
79
|
*
|
|
76
|
-
* Stated as
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* that
|
|
80
|
-
*
|
|
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
|
|
94
|
-
* inconsistency one level down. Both
|
|
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:
|
|
94
|
+
--text-sm: 0.923rem;
|
|
99
95
|
--text-sm--line-height: 1.5;
|
|
100
|
-
--text-xs: 0.
|
|
96
|
+
--text-xs: 0.846rem;
|
|
101
97
|
--text-xs--line-height: 1.5;
|
|
102
98
|
|
|
103
99
|
/* Font weights */
|