Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"apps/docs/next-env.d.ts",
"packages/theme/themes/*.json",
"packages/theme/zed/themes/*.json",
"packages/theme/figma/**/*.json",
"packages/tree-test-data/*-files.json",
"*.patch",
"README"
Expand Down
1 change: 1 addition & 0 deletions packages/theme/.vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ preview/**
.github/**
.vscode/**
zed/**
figma/**

ACCESSIBILITY.md
CONTRIBUTING.md
Expand Down
16 changes: 15 additions & 1 deletion packages/theme/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,25 @@ For visual proofing, `moonx theme:preview --ignore-ci-checks` writes
`preview/*.html`: the palette scales, the Display-P3 conversions, and a
normal-vs-simulated CVD proof sheet.

## Figma variables

`theme:build` also writes `figma/`, a Figma-importable copy of the same colors
in DTCG token format (`src/createFigmaTokens.ts`). `figma/primitives.json` holds
every palette step, and each `figma/semantic/*.json` is one theme variant that
aliases those primitives — Figma turns each of those files into a mode. Commit
the regenerated files alongside `themes/*.json`; see the README for the import
steps.

Semantic tokens are matched back to primitives by hex, so a role value that is
not in any palette scale fails the build. That is deliberate: it catches roles
drifting away from the palette. If a role genuinely needs a standalone literal,
add its hex to `UNALIASED_ROLE_COLORS`.

## Scripts

| Script | Description |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `moonx theme:build` | Builds the theme `.json` files in `./themes` and ESM modules in `./dist` |
| `moonx theme:build` | Builds the theme `.json` files in `./themes`, Figma variables in `./figma`, and ESM modules in `./dist` |
| `moonx theme:test` | Runs validation tests + the CVD accessibility gate after build |
| `moonx theme:preview --ignore-ci-checks` | Writes preview HTML files from `src/previews` into `preview/` |
| `moonx theme:package-vsix --ignore-ci-checks` | Temporarily applies the VSIX package name/README shim, then writes the `.vsix` file at the project root |
Expand Down
13 changes: 13 additions & 0 deletions packages/theme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ Usage:
Zed:
Install "Pierre" from the Zed extension registry

Figma:
Variables ship as DTCG design tokens under figma/

1. Variables view > create a collection named exactly "Pierre Primitives",
then drag in figma/primitives.json
2. Create a second collection, then drag in all of figma/semantic/*.json
together — each file becomes a mode, and its values link back to the
primitives collection from step 1
3. Drag light.json in first so Light lands in the left-most column and
becomes the collection's default mode

The Vibrant variants are not exported: Figma imports sRGB and HSL only.

```

## Agent skill
Expand Down
Loading