@aurea-uds/tokens 0.62.0 → 0.62.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/README.md +65 -80
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,120 +1,105 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Aurea foundations — what the tokens govern, and what they do not
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
porque a auditoria achou os fundamentos documentados em lugar nenhum: densidade e tema prometiam
|
|
5
|
-
coisas que nenhum documento definia, e um quarto dos tokens não tinha quem os usasse (achados M2,
|
|
6
|
-
M17, M18).
|
|
3
|
+
The official answer to "which axis controls this value".
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
The counts live in [`STATE.md`](https://github.com/victor1mor/aurea-uds/blob/main/STATE.md), generated and
|
|
6
|
+
checked. This file holds the rules.
|
|
10
7
|
|
|
11
8
|
---
|
|
12
9
|
|
|
13
|
-
##
|
|
10
|
+
## The axes
|
|
14
11
|
|
|
15
|
-
|
|
|
12
|
+
| Axis | Tokens | Unit | Notes |
|
|
16
13
|
|---|---|---|---|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
34
|
-
**
|
|
35
|
-
|
|
36
|
-
cair, nunca subir.
|
|
14
|
+
| Colour | `--<semantic>`, `--<family>-<step>` | oklch / hex | the semantic token comes first; a ramp step is for building a semantic token, not for direct use |
|
|
15
|
+
| Space | `--space-0` … `--space-24` | rem | the scale skips values on purpose — not every integer exists |
|
|
16
|
+
| Type size | `--text-xs` … `--text-7xl` | rem | |
|
|
17
|
+
| Type family | `--font-ui`, `--font-heading`, `--font-editorial`, `--font-code` | — | Inter / Sora (every h1 to h6) / Inter (alias, removed in 1.0) / IBM Plex Mono |
|
|
18
|
+
| Type weight | `--weight-regular` … `--weight-extrabold` | number | |
|
|
19
|
+
| Line height | `--leading-none` … `--leading-relaxed` | number | `--leading-none` exists for components whose HEIGHT is part of the contract |
|
|
20
|
+
| Letter spacing | `--tracking-tight` … `--tracking-widest` | em | |
|
|
21
|
+
| Radius | `--radius-xs` … `--radius-card`, `--radius-sheet`, `--radius-control` | px | `--radius-card` (22px), `--radius-sheet` (32px, the sheet that rises from the bottom) and `--radius-control` (999px) are identity — checked |
|
|
22
|
+
| Border | `--border-width` | px | |
|
|
23
|
+
| Shadow | `--shadow-sm`, `--shadow-md`, `--shadow-lg` | shadow | |
|
|
24
|
+
| Layer | `--z-sticky` … `--z-toast` | number | for stacking OVERLAYS. A local `z-index: 1/2/3` inside a component is not this axis |
|
|
25
|
+
| Motion | `--duration-*`, `--ease-*` | duration / curve | |
|
|
26
|
+
| Icon size | `--icon-sm` … `--icon-xl` | rem | in rem so the glyph follows the text |
|
|
27
|
+
| Touch target | `--target-min` | rem | 44px with a 16px root — WCAG 2.5.5/2.5.8 |
|
|
28
|
+
| Breakpoint | `--breakpoint-2xs` … `--breakpoint-2xl` | px | `@media` cannot read `var()`, so the CSS repeats each breakpoint in `em` (it follows the browser's font size) and a build check guards the scale |
|
|
29
|
+
| Density | see below | rem | |
|
|
30
|
+
|
|
31
|
+
**A new value on any of these axes comes from a token.** The raw values in the core are counted per
|
|
32
|
+
axis against a baseline: the count may go down, never up.
|
|
37
33
|
|
|
38
34
|
---
|
|
39
35
|
|
|
40
|
-
##
|
|
36
|
+
## The density contract — what actually changes
|
|
41
37
|
|
|
42
|
-
`data-density="compact | comfortable | spacious"`
|
|
38
|
+
`data-density="compact | comfortable | spacious"` changes **eleven** tokens, and only those:
|
|
43
39
|
|
|
44
40
|
`--control-h-xs`, `--control-h-sm`, `--control-h-md`, `--control-h-lg`, `--control-h-xl`,
|
|
45
|
-
`--
|
|
41
|
+
`--touch-control-h-sm`, `--touch-control-h-md`, `--touch-control-h-lg` (the control heights of the native
|
|
42
|
+
touch target), `--row-h`, `--card-pad`, `--section-gap`.
|
|
46
43
|
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
In other words: density changes **control height, table row height, card padding and the gap between
|
|
45
|
+
sections**.
|
|
49
46
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
não uma segunda escala de letras.
|
|
47
|
+
It does **not** change, on purpose: type size, the general space scale, layout gaps, radii, icon sizes
|
|
48
|
+
or line heights. Density is about how close together the controls sit, not a second type scale.
|
|
53
49
|
|
|
54
|
-
|
|
55
|
-
tudo. Todo controle tem de tirar a altura de `--control-h-*` — três famílias não tiravam, e por
|
|
56
|
-
isso uma aba media 8px a menos que o campo ao lado em `spacious` (achado A1). O
|
|
57
|
-
`tests/visual/geometry.spec.ts` cobra isso hoje.
|
|
50
|
+
Every control must take its height from `--control-h-*`. `tests/visual/geometry.spec.ts` checks this.
|
|
58
51
|
|
|
59
52
|
---
|
|
60
53
|
|
|
61
|
-
##
|
|
54
|
+
## The theme contract — and an asymmetry, on purpose
|
|
62
55
|
|
|
63
|
-
`data-theme="dark | light"`.
|
|
56
|
+
`data-theme="dark | light"`. Dark is the base; light overrides it.
|
|
64
57
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
The two themes are **not** fully symmetric, and this is the exception: light overrides three colours that
|
|
59
|
+
dark leaves at the base value — `warning-500`, `oracle-300` and `oracle-400`. Nothing is undefined in dark:
|
|
60
|
+
those tokens inherit the base value, so no value is missing.
|
|
68
61
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
herda da base, então não há valor faltando. O que faltava era este parágrafo.
|
|
72
|
-
|
|
73
|
-
A identidade não muda entre temas: o amarelo principal é `oklch(0.795 0.184 86.047)` nos dois, e o
|
|
74
|
-
check 3 do `validate.py` reprova pelo valor canônico, não só pelo nome do token.
|
|
62
|
+
The identity does not change between themes: the main yellow is `oklch(0.795 0.184 86.047)` in both, and
|
|
63
|
+
the build fails on the canonical value, not only on the token name.
|
|
75
64
|
|
|
76
65
|
---
|
|
77
66
|
|
|
78
|
-
##
|
|
67
|
+
## Units: rem for everything that should follow the text
|
|
79
68
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
tamanho de raiz padrão — os 52 baselines de screenshot provam.
|
|
69
|
+
Type, space, icon size, control height, sidebar width and top bar height are **rem**, so that someone who
|
|
70
|
+
enlarges the browser's text gets bigger controls instead of clipped text (WCAG 1.4.4). The conversion
|
|
71
|
+
from px was exact (px÷16), so nothing moved at the default root size.
|
|
84
72
|
|
|
85
|
-
|
|
86
|
-
|
|
73
|
+
Radii stay in **px**: a corner is a physical shape, not text, and scaling it with the text makes the
|
|
74
|
+
capsule stop being a capsule.
|
|
87
75
|
|
|
88
76
|
---
|
|
89
77
|
|
|
90
|
-
## Tokens
|
|
78
|
+
## Tokens nobody uses
|
|
91
79
|
|
|
92
|
-
|
|
80
|
+
Not every token is referenced by the core. That is not automatically waste:
|
|
93
81
|
|
|
94
|
-
|
|
|
82
|
+
| Group | Why it exists |
|
|
95
83
|
|---|---|
|
|
96
|
-
| `--breakpoint-*`
|
|
97
|
-
| `--oracle-*`
|
|
98
|
-
|
|
|
99
|
-
| degraus de rampa (6) | degraus intermediários das famílias semânticas, mantidos para um consumidor montar uma variante |
|
|
100
|
-
| o resto | usados só pelo `docs.css` — 14 no total |
|
|
84
|
+
| `--breakpoint-*` | `@media` cannot read `var()`. The CSS repeats the number and a build check guards the scale against them |
|
|
85
|
+
| `--oracle-*` | used only by `apps/docs/docs.css`. `oracle` is vocabulary of the app it came from, not of the system — they go away together with that page |
|
|
86
|
+
| ramp steps | intermediate steps of the semantic families, kept so a consumer can build a variant |
|
|
101
87
|
|
|
102
|
-
**
|
|
103
|
-
|
|
104
|
-
raios repetidos) e criou 15 que eram necessários na hora.
|
|
88
|
+
**The rule:** a token is born from a use, not from a scale that looks complete. Tokens that had no use
|
|
89
|
+
anywhere were removed, and the ones that were needed were created.
|
|
105
90
|
|
|
106
|
-
|
|
107
|
-
|
|
91
|
+
Repeats are references, not copies: `--radius-full` is `{radius-control}`, so the two names cannot
|
|
92
|
+
diverge. Two tokens with the same number written by hand diverge the day one of them is adjusted.
|
|
108
93
|
|
|
109
94
|
---
|
|
110
95
|
|
|
111
|
-
##
|
|
96
|
+
## Cascade
|
|
112
97
|
|
|
113
|
-
|
|
114
|
-
CSS
|
|
115
|
-
|
|
98
|
+
`packages/core/dist/aurea.css` wraps the tokens **and** the component CSS in `@layer aurea`. The
|
|
99
|
+
consumer's own CSS, written without a layer, wins over the library whatever the selector's specificity —
|
|
100
|
+
no `!important`, no specificity hunting.
|
|
116
101
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
102
|
+
The tokens sit inside the layer, together with the core, not outside it. A custom property
|
|
103
|
+
**declaration** competes in the cascade like any other: with the tokens outside, the `:root` override
|
|
104
|
+
that the core declares inside a media query lost to the base value, and the sidebar jumped 48px. An app
|
|
105
|
+
that redefines a token in its own unlayered `:root` still wins over both.
|