Design tokens can be added to Interplay in JSON format. Interplay currently supports 2 formats for this JSON:

W3C Community Group - Draft Design Tokens format

The W3C Working group for design tokens has specified a draft token file format that can be found here: Design Tokens Format

The format is a nested JSON structure, with objects containing groups of token values. For example:

{
  "parentGroupX": {
    "description": "Description of parentGroupX",
    "subgroup1": {
      "description": "Description of subgroup1",
      "tokenA": {
        "description": "Description of token A",
        "type": "color",
        "value": "#000000"
      },
      "tokenB": {
				"description": "Description of token B",
        "type": "color",
        "value": "#FFFFFF"
      }
    }
  }
}

Summary of format:

Token type

You can specify any type string for your tokens.

Currently the following type values are recognised as having special meaning in Interplay:

Theme UI format

Theme UI format has a similar nested structure, but with certain keys expected at the top level of the JSON object.

You can find details of this spec here: https://theme-ui.com/theme-spec/

When importing the ThemeUI format the top-level keys are treated as groups of tokens, with the token values inside.