@primitiv-ui/tokens 0.1.27 → 0.1.29
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 +28 -0
- package/package.json +1 -1
- package/src/context.json +5573 -1945
- package/src/dark-mode-content.test.ts +156 -0
- package/src/intent.json +181 -21
- package/src/palette.json +420 -0
package/README.md
CHANGED
|
@@ -119,3 +119,31 @@ backup "real".
|
|
|
119
119
|
key in that file (e.g. `palette.json` has `light` and `dark` keys).
|
|
120
120
|
- Single-mode collections (`Primitives`, `Interaction`) are read from
|
|
121
121
|
`defaultModeId` and emitted flat.
|
|
122
|
+
|
|
123
|
+
## Dark mode: this repo and Figma encode it *oppositely*
|
|
124
|
+
|
|
125
|
+
Both are correct. They just put the inversion in different places, and knowing
|
|
126
|
+
which is which is the difference between reading a real bug and inventing one.
|
|
127
|
+
|
|
128
|
+
| | Where the flip lives | `content/primary` |
|
|
129
|
+
|---|---|---|
|
|
130
|
+
| **This repo** (`intent.json` + `palette.json`) | the **palette** flips per theme (`color.neutral.900` is `#121418` under `light`, `#e5ecf6` under `dark`) | `{color.neutral.900}` in **both** blocks |
|
|
131
|
+
| **Figma** | the **semantic alias** flips; `Primitives / Palette` stays pinned to **Light** on dark frames | `neutral/900` in Light, `neutral/50` in Dark |
|
|
132
|
+
|
|
133
|
+
So in `intent.json` a semantic token usually names the **same ramp step in both
|
|
134
|
+
blocks** and lets the inverted dark palette do the work; in Figma the palette is
|
|
135
|
+
held still and the alias moves. Emitted CSS follows the repo model — the
|
|
136
|
+
`[data-theme="dark"]` block re-points `--primitiv-color-neutral-*` itself, so
|
|
137
|
+
every semantic token above it can keep one step.
|
|
138
|
+
|
|
139
|
+
> **Don't diff the two by ramp index.** Doing that reports ~24 bogus mismatches
|
|
140
|
+
> across nearly all of Dark mode (hit 2026-07-28 during the RFC 0022/0023 Figma
|
|
141
|
+
> cross-check). Resolve each side through its own model first: **13 of 23** dark
|
|
142
|
+
> tokens are then byte-identical, and the remaining 10 differ by only 3–9/255
|
|
143
|
+
> because harmoni *generates* the dark ramp instead of literally reversing it, so
|
|
144
|
+
> only the endpoints (`50`↔`900`) mirror exactly. Reviewed and accepted as-is —
|
|
145
|
+
> those interior dark values aren't expressible as a light-palette alias, so
|
|
146
|
+
> there is nothing better for Figma to point at, and retargeting its dark aliases
|
|
147
|
+
> to this repo's steps would resolve them through Palette/Light and turn dark
|
|
148
|
+
> greys pale. The Figma side of this is in the `figma-variable-architecture`
|
|
149
|
+
> skill.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primitiv-ui/tokens",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.29",
|
|
4
4
|
"description": "The DTCG-conformant design-token layer for the Primitiv ecosystem, plus helpers that transform Figma variable exports into DTCG JSON.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|