This repository (or “repo”) is used for work in the Design Tokens Community Group, governed by the W3C Community License Agreement (CLA). To make substantive contributions, you must join the Community Group.
For more details, read the Contribution Mechanics section of the community group's charter.
If you are not the sole contributor to a contribution (pull request), please identify all contributors in the pull request comment.
To add a contributor (other than yourself, that's automatic), mark them one per line as follows:
+ @github_usernameIf you added a contributor by mistake, you can remove them in a comment with:
- @github_usernameIf you are making a pull request on behalf of someone else but you had no part in designing the feature, you can remove yourself with the above syntax.
The following section is for previewing designtokens.org and the technical reports on your local machine.
This repo requires Node.js (if you need to manage multiple versions of Node.js, fnm is highly-recommended) and pnpm installed. With both installed, clone this repository locally, and in a terminal run in the project root:
pnpm i
pnpm run install-browsers
pnpm run devThe local site will be available at localhost:4321.
The following commands can be run from the project root:
| Command | Description |
|---|---|
pnpm run dev |
Run designtokens.org locally in development mode. |
pnpm run lint |
Lint the project. |
pnpm run spellcheck |
Run spellcheck. |
pnpm run build |
Make a static build of the website. |
Note
You’ll also find pnpm run dev commands both in www and technical-reports folders. Those should only be used for debugging purposes, as they only run part of the workflow.
This repo contains the following sub-directories that house different projects:
| Directory | Description |
|---|---|
meeting-notes/ |
Notes from past meetings. |
technical-reports/ |
The design tokens specification. |
www/ |
The designtokens.org code. |
This project uses cSpell for spell checking. The spellcheck is case-sensitive, so it will detect when words like Bézier or GitHub need proper capitalization.
Words may be globally allowed or globally blocked by adding to the cspell/ folder. See the cSpell documentation on dictionaries for more info.
To override instances without adding to the list, either add a // cSpell: disable comment or // cSpell:words [list of comma-separated words] comment. See the [cSpell documentation on overrides]https://cspell.org/docs/Configuration/document-settings#words) for more info.
Note
This should only be done by a spec editor.
These are the general steps to cut a new release of the report.
The following steps clean, update, and get your local copy into an ideal state. This prevents errors while publishing such as corrupted caches, as well as any accidental local files that should not be part of the new version.
- Pull latest:
git pull - Reset your local repo (optional but recommended):
git clean -dfx(⚠️ this will erase any files not tracked in git, so if you have any temporary files you want to keep, move them out of the repo first). - Reinstall deps:
pnpm i
- Update ReSpec: Update the information in technical-reports/TR/index.html, as well as all other reports. Things include, but aren’t limited to:
- isPreview MUST be
falsefor building⚠️ do not commit this change - subtitle
- specStatus
- prevVersion
- for more, see ReSpec documentation
- isPreview MUST be
- Run a build:
pnpm run build - Rename: Rename
www/src/pages/TR/draftstowww/src/pages/TR/[new version]. Be sure to commit this folder! - Update table: Update www/src/pages/technical-reports.md
At the end of this you should see changes you can commit in www/src/pages/TR/[new version]. This will now be a permanent version, and every change will be tracked manually.