Concepts
DTCG 2025.10
Primitree maps Figma variables to Design Tokens Community Group format.
The converter emits DTCG 2025.10 plus a documented boolean extension. The output includes token documents and a DTCG Resolver document for Figma modes.
Mapping rules
| Figma data | Emitted token data |
|---|---|
| Collection | Base file such as primitives.tokens.json |
| Non-default mode | Override file such as semantic.dark.tokens.json |
| Variable name | Nested token path split on / |
| Variable alias | {dot.path} reference |
COLOR | $type: color with an sRGB value |
FLOAT | Infer type from scope and name; fall back to number |
STRING | $type: fontFamily for matching scope/name, else string |
BOOLEAN | $type: boolean, the documented Primitree extension |
Figma metadata
Each emitted token stores source metadata under $extensions['com.primitree']:
variableIdcollectionIdandcollectionNamescopesandcodeSyntaxwhen presenthiddenFromPublishingwhen trueresolvedType: 'BOOLEAN'for the boolean extension
For example:
{
"$type": "boolean",
"$value": true,
"$extensions": {
"com.primitree": {
"variableId": "VariableID:12:34",
"collectionId": "VariableCollectionId:12:1",
"collectionName": "Features",
"resolvedType": "BOOLEAN"
}
}
}The DTCG 2025.10 type list excludes boolean. Configure strict validators to accept the extension, transform the boolean tokens, or omit them before validation.
Multiple modes
The base file contains values from the collection's default mode. The converter writes an override file for each other mode:
semantic.tokens.json # Light (default)
semantic.dark.tokens.json # Dark modeThe Resolver lists the base set, mode contexts, defaults, and merge order.
Further reading
- Pipeline output
@primitree/dtcgfor programmatic conversion