@x12i/tokens 1.0.0 → 1.1.0
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 +24 -0
- package/dist/chunk-W3FHW2SE.js +690 -0
- package/dist/chunk-W3FHW2SE.js.map +1 -0
- package/dist/design-md.d.ts +21 -0
- package/dist/design-md.js +312 -0
- package/dist/design-md.js.map +1 -0
- package/dist/index.js +1 -688
- package/dist/index.js.map +1 -1
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ Style Dictionary into everything the kit needs.
|
|
|
8
8
|
| CSS custom properties, prefixed `--kit-` | `@x12i/tokens/css/*.css` | Runtime theming |
|
|
9
9
|
| Tailwind v4 `@theme` mapping | `@x12i/tokens/tailwind.css` | Utility classes that read the same variables |
|
|
10
10
|
| Typed TypeScript constants | `@x12i/tokens` | Charts and canvases that need raw values |
|
|
11
|
+
| `DESIGN.md` text | `@x12i/tokens/design-md` | Telling a coding agent what the kit looks like |
|
|
11
12
|
| Tokens Studio JSON | `@x12i/tokens/tokens-studio.json` | Syncing with Figma |
|
|
12
13
|
| DTCG source | `@x12i/tokens/dtcg/*` | Your own tooling |
|
|
13
14
|
|
|
@@ -45,6 +46,29 @@ Tailwind v4:
|
|
|
45
46
|
Utilities mirror token paths, for example `bg-bg-surface` and `text-text-secondary`.
|
|
46
47
|
The mapping uses `@theme inline`, so switching `data-theme` needs no rebuild.
|
|
47
48
|
|
|
49
|
+
## DESIGN.md
|
|
50
|
+
|
|
51
|
+
A [DESIGN.md](https://github.com/google-labs-code/design.md) is the file a coding
|
|
52
|
+
agent reads to learn a project's visual identity: colors, type, spacing, shapes,
|
|
53
|
+
components and a few rules in prose. `createDesignMd` writes one for the kit from
|
|
54
|
+
the tokens in this package, so it cannot drift from the CSS.
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { createDesignMd } from "@x12i/tokens/design-md";
|
|
58
|
+
|
|
59
|
+
const markdown = createDesignMd({ theme: "dark" }); // "light" (default), "dark" or "hc"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Each theme gets its own file, with that theme's real color values. The prose names
|
|
63
|
+
the kit's CSS variables, covers motion, and ends with do's and don'ts, including
|
|
64
|
+
running `kit doctor` before finishing. `npx @x12i/kit-cli design` writes the file
|
|
65
|
+
into a project.
|
|
66
|
+
|
|
67
|
+
It lives in its own entry, so apps that only want the token constants do not load
|
|
68
|
+
the generator (about 15 KB). The tests lint every theme's file with
|
|
69
|
+
`@google/design.md` and fail on a broken reference or a contrast problem between
|
|
70
|
+
a component's text and its background.
|
|
71
|
+
|
|
48
72
|
## Scripts
|
|
49
73
|
|
|
50
74
|
- `pnpm build:tokens` compiles the DTCG source. The TypeScript constants land in
|