prefix-by

This parser helps you prefix the name of your collections, groups and tokens from your SDTF token tree.

Interface

interface parser {
  name: 'prefix-by';
  options: ({
    all: string
  } | 
  {
    group?: string;
    collection?: string;
    token?: string;
  }) & { applyTo?: SDTFQuery }
}

Options

Parameter
Required
Type
Default
Description

all

false

string

Select all collections, groups and tokens in your SDTF token graph.

group

false

string

Select all groups in your SDTF token graph.

collection

false

string

Select all collections in your SDTF token graph.

token

false

string

Select all tokens in your SDTF token graph.

applyTo

false

Basic usage: Prefix color tokens

{
  "spacing": {
    "1": {
      "$type": "dimension",
      "$value": {
        "default": {
          "value": 4,
          "unit": "px"
        }
      }
    }
  },
  "colors": {
    "black": {
      "$type": "color",
      "$value": {
        "default": {
          "model": "hex",
          "hex": "#000000",
          "alpha": 1
        }
      }
    }
  }
}

Last updated