Docs Artifacts
Path: dist/docs/
This is codegen’s fifth target (docsTarget), and the only target that does not use handlebars templates — it assembles strings directly in code.
The three artifacts
Section titled “The three artifacts”tokens.md — the token quick-reference table
Section titled “tokens.md — the token quick-reference table”Split into ## sections by top-level namespace (button / cell / checkbox / color / dialog / icon / input / loading / motion / navbar / picker / radio / radius / shadow / spacing / switch / tag / text / textarea / toast / typography / zIndex), each section a five-column table:
## button
| Token | Type | Light | Dark | Description || --- | --- | --- | --- | --- || `button.borderRadius` | dimension | 2px | — | The button's corner radius follows the global radius || `button.height.medium` | dimension | 40px | — | Native-only addition; medium button height (default) || `color.primary.default` | color | #2B4C7C → #2b4c7c | #3D649E → #3d649e | Primary color (indigo — 青花瓷 (ceramic blue)) |Characteristics:
- The token column holds the full dot path
- The color columns show both the original value and the normalized lowercase form
nativeOnlyentries are annotated in the description column as a native-only addition- The dark column is
—when there is no override (dark mode currently only overridescolor.*)
tokens.light.json — a flat light snapshot
Section titled “tokens.light.json — a flat light snapshot”{ "button.borderRadius": "2px", "button.fontWeight": 400, "button.height.medium": "40px", "color.primary.default": "#2B4C7C"}A flat { path -> baked value } mapping, for machine consumption.
tokens.dark.json — the dark override map
Section titled “tokens.dark.json — the dark override map”{ "color.focus": "#7FA6D9", "color.selected": "#B1C1D8", …}Contains only the overridden keys (all of them color.*; the exact count changes between versions), sorted by path.
Consumers
Section titled “Consumers”| Consumer | What it uses |
|---|---|
| This documentation site | Does not consume dist/docs/ directly — the Token Reference page is rendered live by an .astro page running the same loadTokenFiles + resolveTokens pipeline, always in sync with the sources |
| The family documentation site | Embeds tokens.md as a token quick reference |
| Cross-target alignment | tokens.light.json / tokens.dark.json for build-time comparison |
| Baseline-document filtering | The nativeOnly annotation, for the “native-only tokens” list |
Header guard
Section titled “Header guard”The top of tokens.md:
<!-- This file is auto-generated by @lh-ui/core. Do not hand-edit. Source: @lh-ui/core tokens -->Same principle as every target’s “do not hand-edit” banner (red line 6).
Difference from the documentation site’s reference page
Section titled “Difference from the documentation site’s reference page”dist/docs/tokens.md |
The site’s Token Reference page | |
|---|---|---|
| Generated when | pnpm codegen |
pnpm docs:build / docs:dev |
| Data source | The in-memory tokenSet of codegen |
The .astro page frontmatter re-runs loadTokenFiles + resolveTokens |
| Shape | A static markdown table | An interactive Astro table (filtering, color swatch previews) |
| Location | dist/ (gitignored, not committed) |
A site page (the build output lives in docs/dist/) |
Both run the same resolution pipeline, so the values are always identical; they differ only in presentation shape and build entry point.
Copyright © 2024-2026 FengMo WenXue