Primitree
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 dataEmitted token data
CollectionBase file such as primitives.tokens.json
Non-default modeOverride file such as semantic.dark.tokens.json
Variable nameNested token path split on /
Variable alias{dot.path} reference
COLOR$type: color with an sRGB value
FLOATInfer 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']:

  • variableId
  • collectionId and collectionName
  • scopes and codeSyntax when present
  • hiddenFromPublishing when true
  • resolvedType: '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 mode

The Resolver lists the base set, mode contexts, defaults, and merge order.

Further reading