Only this pageAll pages
Powered by GitBook
1 of 46

V1

Getting started

Loading...

Loading...

Loading...

Loading...

Advanced Repository

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Concepts

Loading...

Loading...

Loading...

Loading...

Apps & Tools

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Useful links

What is Specify?

We provide the first Design Data Platform allowing you to send your design tokens and assets across your design system tools. Specify is built with this idea: configure once, synchronize anytime.

Specify is a central and tool-agnostic platform. It means you can integrate your daily applications to collect, store and distribute your design decisions to the right teams, in the right format, at the right time. To sum things up, see Specify as the synchronization layer for your design data at the heart of your design system.

  • Designers, connect your favorite design tool, like Figma, and let Specify monitor and collect your design tokens and assets automatically. This way, you control what is sent to developers and reduce the risk of inconsistencies.

  • Developers, configure tailored transformation pipelines for every project and get design tokens and assets from wherever you want. Use our or get automated Pull Requests.

  • Teams can benefit from a single source of truth and a continuous delivery system that ensures brand consistency.

In short, you have more time to focus on what matters most: your products and your end-users.

Introduction

Welcome to the Specify docs! Learn about how to use and integrate Specify in your workflow to sync your design tokens and assets in your design system.

CLI
GitHub

Getting started

A short guide on collecting and pulling your first design tokens and assets.

Concepts

Learn our terminology and concepts used in Specify.

Apps & Tools

Discover and learn more about

our official integrations.

Configuration templates

Start in seconds with our ready-to-use config templates.

Tutorials

Watch our YouTube videos to get started with Specify.

Community

Join our Discord community to learn and share tips.

Cover
Cover
Cover
Cover
Cover
Cover

Templates

Automatically distribute your design tokens and assets according to your organization's standards with our ready-to-use configuration templates.

Ready-to-use configuration templates for your next project

This section will help you get started with ready-to-use configuration template. Each configuration file will be filled by one or several rules, called parsers.

Parsers are functions allowing you to transform design tokens and assets coming from Specify to fit your needs and company standards.

Make sure to read the to better understand how configuration file works with Specify.

Template
Description

Playground

Learn how to use the Specify Playground to iterate more easily on your configuration files

Introduction

The Specify Playground helps you run parsers against a token graph and see the generated output in live. It's a great tool to help you iterate on your configuration files or try new parsers on the go.

https://iframe.specifyapp.com/sdtf-playground/index.html

Usage

  • The left side panel contains the SDTF graph you'll run your rules against. It's editable and you're free to use your own SDTF graph which you can get with the to-sdtf parser.

  • The middle panel contain your Specify configuration rule.

  • The right side panel displays the generated code

GitHub

Learn how to distribute your design tokens from Specify to your GitHub repositories via automated Pull Requests.

Please make sure you have:

  • A GitHub account

  • A Specify account

  • One or multiple new Advanced Repositories Specify repositories containing some design tokens.

Tailwind

This template helps you generate your design tokens as a Tailwind theme.

This example uses the following parser:

  • to generate your design tokens as a Tailwind theme

If you use the CLI, you need to fill three properties:

  • repository

Raycast

Learn to get and use your design tokens and assets right from Raycast.

Our Raycast extension helps you search your design tokens and assets and use them in your favorite tools: Notion pages, Pitch presentations, Slack discussions, etc.

Please make sure you have:

  • installed

  • A Specify account

Best practices

Your Specify personal access token should always be private. We highly recommend you to set it in a private variable or in a .env variable.

Set your personal access token as an environment variable and interpolate it in the CLI wit .

CLI

The Specify CLI helps you pull design tokens and assets from Specify right from your terminal.

Use the Specify CLI to integrate Specify in your workflow.

You can use the Specify CLI to:

  • Pull your design tokens in the right format using parsers

  • Test your configuration before using it in a GitHub repository

Glossary

Specify is built on core concepts such as sources, destinations, pipelines, parsers. This page will help you understand all of them.

A Design API is an API designed to synchronize information in your design system. This includes design tokens, assets, components and documentation.

A source is a place that contains data you want to sync within your design system. Like a Figma file from which you sync your colors from. Or a GitHub repository containing your design tokens in JSON.

A destination is a place in which you distribute data in. Like a GitHub repository consuming colors coming from your design system or a Notion database in which you document your icons.

A pipeline is the route that connects a Source or a Destination to Specify. It helps you transform and synchronize data (e.g., design tokens) within your design system.

A repository is like a folder containing your design tokens and assets in Specify. Use repositories to store and organize your design data.

A Token type is a type of design token or asset supported by Specify like a colors, a text style or an icon.

CSS Custom Properties

This template is dedicated for Web developers using CSS. It helps you generate all types of design tokens as CSS Custom Properties in their respective CSS file.

SDTF

This template helps you pull your design tokens in the SDTF format in a JSON file.

Tailwind

This template helps you generate your design tokens as a Tailwind theme.

Configuration section
.

By default Specify returns design tokens and assets in JSON. Configure it to generate design data compatible with your company standards (e.g., CSS Variables).

A rule is a part of your configuration that helps you transform one or several Token types the way you want. Like a rule to pull colors from Specify as CSS Variables in a CSS file.

Parsers are functions allowing you to transform design tokens and assets coming from Specify to fit your needs and company standards. See all parsers.

Design API

Source

Destination

Pipeline

Repository

Token type

See all token types

Configuration

Rule

Parser

Set your personal access token as a variable

Using an .env variable in a config file in JavaScript

Using a variable in a flag with the CLI

You can use this method to sync Specify with git repositories in GitLab, GitHub, Azure DevOps or Bitbucket.

the flag -p
.env
SPECIFY_TOKEN=ab83f8f49f5c65456c7b1fe70efbc804aa08f87150214aa984d4125945ed8283bash
const path = require('path');
const envFile = '.env';
require('dotenv').config({ path: path.resolve(process.cwd(), envFile) });

module.exports = {
  repository: '@workspace/repository',
  personalAccessToken: process.env.SPECIFY_TOKEN,
  rules: [],
};
specify pull -p $SPECIFY_TOKEN
  1. Go to the applications catalog on the Destinations page

  2. Select GitHub

  3. Click on "Connect"

  4. Select the repositories you want Specify to have access to

  5. You will now be able to connect your Specify and your GitHub repositories together 🎉

Once you've connected your GitHub account, Specify has to know what design tokens to synchronize and how.

  1. Go to the Specify Advanced Repository you want to distribute design data from

  2. Go to its "Destinations" page

  3. Click on "Create Pipeline"

  4. Select "GitHub application"

  5. Select your GitHub account

  6. Select the GitHub repository you want to distribute your design data to

  7. Name for your configuration file ()

  8. Create the Pull Request containing your configuration file

  9. Merge the PR created by Specify containing your configuration file

  10. Specify will now automatically sync design data to your GitHub repository 🎉

  • How to sync design tokens in a GitHub monorepo

  • How to run Style Dictionary with a GitHub Action

Specify will sync your GitHub repository if you have a config file .specifyrc.json saved at the root of your GitHub repository.

Prerequisites

Want to connect a GitHub repository from your GitHub organization? Please make sure you have the correct access rights. Otherwise, you'll need an owner to approve your installation request.

Installation

Connecting Specify and GitHub

Useful resources

is
@organization/repository
  • personalAccessToken which you can generate in your account settings

  • rules are where you provide parsers and compatible options

  • If you use the GitHub, you need to fill two properties:

    • repository is @organization/repository

    • rules lets you transform tokens by chaining parsers

    Make sure you have connected your GitHub account with your Specify account. Head toward to learn more.

    {
      "version": "2",
      "repository": "@organization/repository",
      "rules": [
        {
          "name": "Generate tokens as a Tailwind theme",
          "parsers": [
            {
              "name": "to-tailwind",
              "output": {
                "type": "file",
                "filePath": "theme.js"
              }
            }
          ]
        }
      ]
    }
    to-tailwind
    {
      "version": "
    

    A Specify repository containing some design tokens and/or assets

  • Generated a Personal Access Token for Raycast

  • You can sync the following Token types in Raycast:

    • color

    • bitmap

    • vector

    1. Install the Specify Raycast extension from the Raycast store

    2. Set your newly created Personal Access Token in Raycast

    Are you looking for a specific color from your design system? Open Raycast and type in Search Colors.

    The main action is to copy the hexadecimal value of your color. You can also access other actions like copying the value in RGBA or the name of the color by accessing the action menu via Cmd + K.

    Are you looking for a .jpg or .png file, such as a logo or photo of a team member? As with the previous search, open Raycast and type in Search Bitmaps.

    Are you looking for a .svg file, such as a logo or an icon? Just open Raycast and type in Search Vectors.

    Prerequisites

    Raycast

    Need a personal access token?

    Supported Token types

    Installation

    Usage

    Search colors

    Search bitmaps

    Search vectors

    Sync a Specify repository

    Install @specifyapp/cli via npm or Yarn.

    npm install -g @specifyapp/cli
    yarn global add @specifyapp/cli

    Initialize a Specify configuration tailored for a specific output format. See all configuration templates.

    Pull design tokens and assets from your Specify repository.

    Sync a Specify repository to update its design tokens and assets.

    Flags are parameters you can pass while launching the command. All of these parameters are optional if you use a config file.

    Relative path to your Specify config file.

    The name of the Specify repository you want to pull your design tokens and assets from.

    The Specify Personal Access Token used to authenticate your actions.

    Rules Specify will follow to generate design tokens and assets in your desired output format.

    Execute command without actually writing files. Use this flag to test the output of a configuration without generating files.

    Introduction

    specify init
    specify pull [flags]
    specify sync [flags]

    Installation

    Commands

    Init

    Pull

    Sync

    Flags

    -C, --config-path

    -r, --repository

    -p, --personal-access-token

    Need a personal access token?

    -R, --rules

    --dry-run

    Getting started

    A 5min guide on collecting and pulling your first design tokens and assets with Specify.

    Introduction

    In this guide you’ll learn how to pull your first design tokens and assets to CSS Custom Properties using the Specify CLI.

    This guide helps you to sync tokens from Figma local styles and frames to Specify. Want to sync Figma Variables instead? to learn more.

    Before getting started

    To get the most out of this guide, you’ll need:

    • A Specify account

    • A Specify repository containing some design tokens and assets (Learn more ↗)

    1. Install the CLI

    Install @specifyapp/cli via npm or Yarn.

    Create a configuration file for your desired output format using one of our templates ↗️

    Add your Specify repository from which you want to pull your design tokens and assets. .

    Generate a personalAccessToken for the CLI and add it in your configuration.

    Our configuration is ready and we can now pull our design tokens and assets using the pull command.

    Notion

    Learn how to automatically document your design tokens and assets from Specify to your Notion workspace.

    Introduction

    Use our Notion integration to:

    • Document your brand guidelines

    • Create public pages for press and brand kits

    • Automate the maintenance of your design system documentation

    Please make sure you have:

    • A Notion account

    • A Specify account

    • A Specify repository containing some design tokens and/or assets

    You can sync the following in Notion:

    • color

    • measurement

    • textStyle

    • bitmap

    SDTF

    This template helps you pull your design tokens in the SDTF format in a JSON file.

    This example uses the following parser:

    • to-sdtf to generate your design tokens in SDTF

    If you use the CLI, you need to fill three properties:

    • repository is @organization/repository

    • personalAccessToken which you can generate

    • rules are where you provide parsers and compatible options

    If you use the GitHub, you need to fill two properties:

    • repository is @organization/repository

    • rules lets you transform tokens by chaining parsers

    GitHub

    Learn how to distribute your design tokens and assets from Specify to your GitHub repositories via automated Pull Request.

    By default, Specify can only syncs your GitHub repository if you have a config file .specifyrc.json at the root of your GitHub repository. If you want to sync design tokens from several Specify repositories you need to run the Specify CLI inside a GitHub Action.

    Prerequisites

    Please make sure you have:

    • A GitHub account

    • A Specify account

    • A Specify repository containing some design tokens and/or assets

    Want to connect a GitHub repository from your GitHub organization? Please make sure you have the correct access rights. Otherwise, you'll need an owner to approve your installation request.

    Installation

    1. Go to the applications catalog

    2. Select GitHub

    3. Click on "Connect"

    4. Select the repositories you want Specify to have access to

    Once you've connected your GitHub account, Specify has to know what design tokens to synchronize and how.

    1. Go to the Specify repository page you want to distribute design data from

    2. Go to its "Destinations" page

    3. Click on "Create Pipeline"

    4. Select "GitHub application"

    Have trouble getting Pull Requests in your GitHub repository? Learn more about .

    npm

    Learn how to distribute your design tokens and assets from Specify as npm or GitHub packages.

    Workflow

    This integration helps you generate design tokens and assets as private or public packages in a npm or a GitHub registry.

    Workflow to distribute design tokens from a source (i.e Figma) as npm packages
    Workflow to distribute design tokens from a source (i.e Figma) as GitHub packages

    Choose npm if...

    Choose npm if you already have a private npm registry, we suggest you distribute your npm packages there. It will prevent you from creating a public npm package that will take an unnecessary public namespace.

    Also, , so make sure your package needs to be public before making it as is 👍

    Choose GitHub if...

    Choose GitHub if you want to keep your packages private to your GitHub organization without paying for an npm team account.

    Choose a custom registry if...

    Choose a custom registry if your company uses its own registry. If you have specific security constraints like IP whitelisting or custom authentication.

    Prerequisites

    Please make sure you have:

    • An npm account, a GitHub account, or access to a custom registry

    • A Specify account

    • A Specify repository containing some design tokens and/or assets

    1. Go to your Specify repository you want to distribute your design tokens from

    2. Go to the "Destinations" page and click on "Create pipeline"

    3. Select "npm packages"

    4. Select your existing npm app, or create a new one by setting your or

    CLI & Config

    In this guide you’ll learn how to transform design data coming from Figma Variables, Figma Styles and/or Tokens Studio into CSS Custom Properties using the Specify CLI.

    Install the @specifyapp/cli via npm or Yarn.

    To create your Specify config file, you need to follow these steps:

    • Create an empty file named .specifyrc.json

    Figma Variables & Styles

    In this guide, you’ll learn how to sync your Figma Variables and/or Styles to a Specify Repository and how to keep them updated.

    To get the most out of this guide, you will need:

    • A Specify Account

    • A Figma file containing Variables and/or Styles

    select-modes

    This parser helps you select design tokens from specific mode(s).

    Parameter
    Required
    Type
    Default
    Description

    Overview

    List of all apps you can use with Specify to sync, read and transform your design tokens and assets.

    Getting started

    Here’s a 5 minute guide on how to use different features within the Advanced Repository based on the Specify Design Token Format.

    Specify is building an entirely new Design Token Format (SDTF) to base our platform on a new design token graph. In short, this means that we are developing a format that enables more possibilities to add code-type sources and destinations than before. The new graph will facilitate managing a large number of design token types and assets. Next to this, it opens doors to more advanced features such as Aliases, Modes, and Collections.

    In a more practical sense, the SDTF opens up compatibility with and as a source alongside the existing Figma local styles compatibility. It also creates opportunities to create code output that includes aliases, modes, and collections.

    All of these features come together in the Specify Advanced Repository.

    Learn More ↗︎
    2
    "
    ,
    "repository": "@organization/repository",
    // Only use the personalAccessToken when working with the CLI
    "personalAccessToken": "<your-personal-access-token>",
    "rules": [
    {
    "name": "Generate tokens as a Tailwind theme",
    "parsers": [
    {
    "name": "to-tailwind",
    "output": {
    "type": "file",
    "filePath": "theme.js"
    }
    }
    ]
    }
    ]
    }
    this article
    Generate one ↗
    Cover

    GitHub

    Learn how to distribute your design tokens and assets via automated Pull Requests.

    Cover

    GitLab

    Learn how to distribute your design tokens and assets via automated Merge Requests.

    Cover

    Azure DevOps

    Learn how to distribute your design tokens and assets via automated Pull Requests.

    Cover

    REST API

    Learn how to sync design tokens and assets with the Specify REST API.

    Cover

    CLI

    Learn how pull design tokens and assets from Specify right from your terminal.

    Cover

    Notion

    Learn how to automatically document your design tokens and assets from Specify to your Notion workspace.

    Cover

    Raycast

    Learn to get and use your design tokens and assets right from Raycast.

    Cover

    Bitbucket

    Learn how to distribute your design tokens and assets via automated Pull Requests.

    Cover

    npm

    Learn how to distribute your design tokens and assets as npm packages.

    Generate one ↗
    personal access token, then set your registry
  • Configure your package name, access type (public / private), and module type (Common JS / ES Modules)

  • Set your Specify configuration file. If you host your config file on an external service like JSONBIN make sure to make your BIN public (See example). Also, your config only needs the rules property.

  • Installation

    Useful resources

    npm
    GitHub
    GitHub Packages Documentation
    npm Docs
    removing a public npm package has consequences
    Workflow to distribute design tokens from a source (i.e Figma) as npmpackages

    Make sure you have connected your GitHub account with your Specify account. Head toward this article to learn more.

    in your account settings
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Generate tokens in SDTF",
          "parsers": [
            {
              "name": "to-sdtf",
              "output": {
                "type": "file",
                "filePath": "output/tokens.json"
              }
            }
          ]
        }
      ]
    }
    {
      "version": "2",
      "repository": "@organization/repository",
      "rules": [
        {
          "name": "Generate tokens in JSON",
          "parsers": [
            {
              "name": "to-sdtf",
              "output": {
                "type": "file",
                "filePath": "output/tokens.json"
              }
            }
          ]
        }
      ]
    }

    font

  • vector

  • Prerequisites

    Want to connect a Notion page from your Notion workspace? Please make sure you have the correct access rights. Otherwise, you'll need for an owner to approve your installation request.

    Supported Token types

    Installation

    Token types

    You will now be able to connect your Specify and your GitHub repositories together 🎉

    Select your GitHub account

  • Select the GitHub repository you want to distribute your design data to

  • Select your configuration template (Learn more)

  • Create the Pull Request containing your configuration file

  • Merge the PR created by Specify containing your configuration file

  • Specify will now automatically sync design data to your GitHub repository 🎉

  • Connecting Specify and GitHub

    Fixing sync issues

    Useful resources

    on the Destinations page
    how to fix the most common issues
    How to pull design tokens from several Specify repositories in GitHub
    How to run Style Dictionary with a GitHub Action

    Add the following content

    {
      "version": "2",
      "repository": "@organization/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "CSS Styles",
          "parsers": [
            {
              "name": "to-css-custom-properties",
              "output": {
                "type":"file",
                "filePath": "style.css"
              }
            }
          ]
        },
        {
          "name": "Raw SDTF",
          "parsers": [
            {
              "name": "to-sdtf",
              "output": {
                "type":"file",
                "filePath": "raw.json"
              }
            }
          ]
        }
      ]
    }
    • A property version is shown which refers to the new Advanced Repository from which we are extracting tokens. Use the version: "2".

    • Add your organization and repository name under the repository property.

    • Get a personal access token here ↗︎.

    • Run the command specify pull to fetch your design tokens.

    Specify exports your Figma Variables Modes as CSS data-attributes:

    :root[data-Colors="Dark"] {
      --Core-Label-blue-base: rgb(96, 168, 250);
      --Aliases-Icon-info: var(--Core-Label-blue-base);
      --Core-Label-red-base: rgb(221, 72, 64);
      --Aliases-Icon-error: var(--Core-Label-red-base);
      --Core-Neutral-neutral-6: rgb(174, 178, 183);
      --Aliases-Icon-default: var(--Core-Neutral-neutral-6);
      --Core-Label-green-base: rgb(125, 216, 121);
      --Aliases-Icon-success: var(--Core-Label-green-base);
      --Core-Label-orange-base: rgb(255, 158, 41);
      --Aliases-Icon-warning: var(--Core-Label-orange-base);
      --Core-Neutral-neutral-3: rgb(68, 71, 75);
      --Aliases-Icon-disabled: var(--Core-Neutral-neutral-3);
      --Core-Primary-app-base: rgb(98, 77, 227);
      --Aliases-Icon-selected: var(--Core-Primary-app-base);
    }
    :root[data-Dimensions="Mobile"] {
      --Base-dimension-02: 2px;
      --Radii-radius-01: var(--Base-dimension-02);
      --Base-dimension-08: 8px;
      --Radii-radius-02: var(--Base-dimension-08);
      --Base-dimension-04: 4px;
      --Base-dimension-12: 12px;
      --Base-dimension-16: 16px;
      --Base-dimension-24: 24px;
      --Base-dimension-32: 32px;
      --Spacings-spacing-01: var(--Base-dimension-02);
      --Spacings-spacing-02: var(--Base-dimension-04);
      --Spacings-spacing-03: var(--Base-dimension-12);
      --Spacings-spacing-04: var(--Base-dimension-16);
    }
    :root[data-Dimensions="Desktop"] {
      --Base-dimension-02: 2px;
      --Radii-radius-01: var(--Base-dimension-02);
      --Base-dimension-08: 8px;
      --Radii-radius-02: var(--Base-dimension-08);
      --Base-dimension-04: 4px;
      --Base-dimension-12: 12px;
      --Base-dimension-16: 16px;
      --Base-dimension-24: 24px;
      --Base-dimension-32: 32px;
      --Spacings-spacing-01: var(--Base-dimension-04);
      --Spacings-spacing-02: var(--Base-dimension-08);
      --Spacings-spacing-03: var(--Base-dimension-12);
      --Spacings-spacing-04: var(--Base-dimension-16);
    }

    We would like to improve this output according to your needs as much as we can. Feel free to share your feedback with us via:

    • The community ↗

    • The in-app chat

    npm install @specifyapp/cli 
    yarn global add @specifyapp/cli

    1. Install the CLI

    2. Create your Specify configuration file

    3. Properties to update in the configuration file before using it:

    4. CSS output example

    Things to take into account when using the CLI

    • The configuration file can handle MJS, CJS, and JSON.

    • There is no more path property in the parser settings, it is now replaced by an output

    specifyrc.json
    403B
    Open
    Access your Figma file which includes the Variables and/or Styles you would like to sync to Specify
  • Download ↗ the Specify Widget in the Figma file which includes your Variables and/or Styles. Or update the widget if you already have it. To update the Specify Widget you have to disconnect it, remove the entire frame in all of your Figma files, and reopen the latest version of the Widget.

    1. Follow the steps in the widget to connect your account. You will need to create a personal access token and you will need to add the link to the Figma file to which the widget is added. Watch tutorial ↗

    2. Click "Connect"

    3. Choose Advanced Repository

    1. Go to your Specify workspace

    2. Click on "Create repository"

    3. Choose a name

    4. Select "Advanced Repository" (Learn more ↗︎)

    5. Click "Create repository"

    Create a repository in Specify
    1. Go back to your Figma file that includes the Variables and/or Styles

    2. Click on "Create Source" in the Specify Widget

    3. It will show you the local collections and styles that are detected

    4. Select the design tokens format you want to collect from your Figma file. Learn More ↗︎

    5. Select the Specify repository you want to sync with. You should be able to see the Repository you have just created in Specify (if not, reload the list).

    6. Click "Save to Specify"

    7. You will immediately see the repository listed with the latest syncing time

    Create a source in your Specify Widget in your Figma file

    Use the Sync button to update your Variables and/or Styles with Specify. Now you are ready to export your design tokens! 🎉

    Use the sync button to update new variables

    • You will see the category of design tokens that are synced on the left-hand side

    • In the Sources section (left-hand menu), you will see your connection(s) and when the last sync between your Figma file and Specify repository has occurred.

    • Delete your source by clicking on the 3 dots option menu in the source card.

    Before getting started

    1. Sync your Figma Variables and Styles with a Specify Repository

    2. Connect your Specify account

    Note: the widget can be used for syncing Figma Styles from the Classic repositories as well, you can switch between the two by clicking "Switch to".

    3. Create a repository in Specify

    4. Connect the Specify Repository in your Widget

    Make sure to understand that only Advanced repositories are listed here.

    5. Sync updates variables and styles on the fly

    6. Check or delete your source inside the Specify interface

    Array

    The query that select items in the graph.

    {
      "colors": {
    
    1. We want to get all design tokens from the mode named "light"

    2. We eventually generate our design tokens ass CSS variables in a CSS file thanks to the to-css-custom-properties parser.

    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Only get tokens from the mode named 'light' and gererate tokens in CSS",
          "parsers": [
            {
              "name": "select-modes",
              "options": {
                "modes": ["light"]
              }
            },
            {
              "name": "to-css-custom-properties",
              "options": {
                "selectorTemplate": "[data-theme=\"{{mode}}\"]"
              },
              "output": {
                "type": "file",
                "filePath": "public/css-custom-properties.css"
              }
            }
          ]
        }
      ]
    }
    tokens.json
    [data-theme="light"] {
      --danger-dangerToken: rgb(209, 204, 204);
      --info-infoToken: rgb(219, 234, 254);
    }
    interface parser {
      name: 'select-modes';
      options: {
        modes: string[];
      };
    }

    modes

    Interface

    Options

    required

    Basic usage: select all tokens from a mode named "light"

    • Download the Specify Figma Widget ↗

    • Figma Example File ↗

    Introducing the Specify Design Token Format

    Figma Variables
    Tokens Studio
    Cover

    Figma Variables & Styles

    A short guide on collecting Figma Variables & Styles to your Specify repository.

    Useful links

    npm install -g @specifyapp/cli
    yarn global add @specifyapp/cli
    specify init
    module.exports = {
      repository: '@workspace/repository',
      personalAccessToken: '<your-personal-access-token>',
      rules: [],
    };
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": []
    }
    module.exports = {
      repository: '@workspace/repository',
      personalAccessToken: '<your-personal-access-token>',
      rules: [],
    };
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": []
    }
    specify pull

    2. Create your Specify config file

    3. Add your Specify repository

    4. Add your personal access token

    5. Pull your design tokens and assets

    Learn more ↗
    Click here

    REST API

    The Specify API lets you extend Specify functionalities beyond what we provide out of the box.

    New to Specify? Head over to the existing REST API to learn more about why it can be useful for your team and how to use it.

    Endpoint

    Specify provides the following endpoint to help you get design tokens and assets from a Specify repository.

    https://api.specifyapp.com/v2/{workspace}/repository/{repository}/execute-rule

    Parameters

    Get tokens graph

    POST https://api.specifyapp.com/v2/{workspace}/repository/{repository}/execute-rule

    Get design tokens and assets from a Specify repository. You can only execute a single rule with this endpoint.

    Path Parameters

    Name
    Type
    Description
    Name
    Type
    Description

    Once you have your personal access token, you can pass it within the Authorization header of your request.

    Here's a simple example to get tokens in JSON from a repository called all-design-datain the @acme-inc workspace:

    Parsers

    Parsers are functions allowing you to transform design tokens and assets coming from Specify to fit your needs and company standards.

    Not familiar with parsers? Head over to the existing parsers documentation and learn more about why you need them and how to use them.

    You must set a name and your desired output for each parser:

    1. The name is the name of the parser

    2. The output

    "$collection": {
    "$modes": ["light", "dark"]
    },
    "info": {
    "infoToken": {
    "$type": "color",
    "$value": {
    "light": {
    "model": "rgb",
    "red": 219,
    "green": 234,
    "blue": 254,
    "alpha": 1
    },
    "dark": {
    "model": "rgb",
    "red": 219,
    "green": 234,
    "blue": 254,
    "alpha": 1
    }
    }
    }
    },
    "danger": {
    "dangerToken": {
    "$type": "color",
    "$value": {
    "light": {
    "model": "rgb",
    "red": 209,
    "green": 204,
    "blue": 204,
    "alpha": 1
    },
    "dark": {
    "model": "rgb",
    "red": 19,
    "green": 34,
    "blue": 54,
    "alpha": 1
    }
    }
    }
    }
    }
    }

    Tokens Studio

    Learn how to add Tokens Studio as a source in Specify.

    CLI & Config

    Learn more about how to transform and distribute tokens.

    GitHub

    Learn more about how to transform and distribute tokens to GitHub.

    Parsers

    Transform design tokens and assets coming from Specify to fit your needs and company standards.

    REST API

    Extend Specify functionalities beyond what we provide out of the box.

    Cover
    Cover
    Cover
    Cover
    Cover

    workspace*

    String

    The name of your organization in Specify. For instance, in this URL https://specifyapp.com/ @specifyapp/Seeds the workspace is "@specifyapp".

    name

    String

    The name of the Specify repository containing the design data you're requesting. For instance, in this URL https://specifyapp.com / @specifyapp/Seeds the repository is "Seeds".

    parsers*

    Object or Array

    Can contain an object or an array of objects. Each object corresponds to a specific parser.

    name*

    Request Body

    Example

    documentation

    The name of your rule

    curl -X POST 'https://api.specifyapp.com/v2/@acme-inc/repository/all-design-data/execute-rule' \
    --header 'Authorization: <your-personal-access-token>' \
    --header 'Content-Type: application/json' \
    --data '{
        "name": "SDTF",
        "parsers": [
            {
                "name": "as-is",
                "output": {
                    "type": "file",
                    "filePath": "tokens.json"
                }
            }
        ]
    }'
    key inside every parser.
    property indicates which type of output you want the parser to produce

    Parsers support none, some or more output types, please refer to dedicated parser pages for details.

    Use case: the parser is expected to produce exactly one file.

    Directory

    Use case: the parser is expected to produce 0 to N files, all placed in the given directoryPath.

    Example with the to-css-custom-properties parser:

    Parser
    Description
    Usage example

    This parser helps you change the case of names or modes over a SDTF graph.

    We're currently working on making our existing parsers compatible with the SDTF. We'll update this page accordingly.

    General properties

    type FileOutput = {
      type: 'file';
      filePath: string;
    }
    type DirectoryOutput = {
      type: 'directory';
      directoryPath: string;
    }
    "parsers": [
      {
        "name": "to-css-custom-properties",
        "output": {
          "type": "file",
          "filePath": "style.css"
        }
      }
      // ...
    ]

    Output types

    File

    Available parsers

    to-typescript

    This parser helps you pull design tokens as TypeScript objects for all token types and their respective helper functions.

    Interface

    interface parser {
      name: 'to-typescript';
      output: {
        type: 'file';
        filePath: string;
      };
      options?: {
        moduleExport?: 'es6' | 'commonjs';
      };
    }

    Basic usage

    {
      "colors": {
    
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "To TypeScript",
          "parsers": [
            {
              "name": "to-typescript",
              "output": {
                "type": "file",
                "filePath": "tokens.ts"
              }
            }
          ]
        }
      ]
    }
    tokens.js
    /** 
    * @enum {string} All the valid paths for the collection colors.
    * Use it when calling `getColorsTokenByMode`
    */
    export const colorsColorPath = {
      'colors.Core.blue-100': 'colors.Core.blue-100',
      'colors.Core.blue-700': 'colors.Core.blue-700',
      'colors.semantic.background.button.primary.hover': 'colors.semantic.background.button.primary.hover'
    } as const;
    
    export type colorsColorPathType = keyof typeof colorsColorPath;
    
    export type colorsPathType = colorsColorPathType;
    
    /**
    * All the modes of the collection colors.
    * Use it when calling `getColorsTokenByMode`
    */
    export const colorsModes = [ 'light', 'dark' ] as const;
    
    export type colorsModesType = typeof colorsModes[number];
    
    /** 
    * All the tokens of the collection colors.
    * Use `getColorsTokenByMode` to retrieve the tokens
    */
    export const colors = {
      'colors.Core.blue-100': { dark: 'rgb(229, 29, 29)', light: 'rgb(255, 255, 255)' },
      'colors.Core.blue-700': { dark: 'rgb(229, 0, 0)', light: 'rgb(255, 200, 255)' },
      'colors.semantic.background.button.primary.hover': { dark: 'rgb(229, 29, 29)', light: 'rgb(255, 200, 255)' }
    } as const;
    
    /**
    * Retrieve a token for the collection 'colors'.
    * @param {keyof typeof colorsPath} path - The path to the token
    * @param {'light' | 'dark'} mode - The mode of the token you want to retrieve 
    * @returns {number | string} The value of a token for a given mode
    */
    export function getColorsTokenByMode<T extends colorsPathType, M extends keyof typeof colors[T]>(path: T, mode: M) {
      if (!colors[path]) {
        throw new Error("Path: '" + path + "' doesn't exist for collection 'colors'. Here are all the valid paths for each type:" + `
    - color:
        - colors.Core.blue-100
        - colors.Core.blue-700
        - colors.semantic.background.button.primary.hover`)
      }
    
      if (!colors[path][mode]) {
        throw new Error("Invalid mode '" + mode.toString() + "' for collection 'colors' at path '" + path + "', here are all the valid modes:\n- " + Object.keys(colors[path]).join('\n- '))
      }
    
      return colors[path][mode]
    }

    to-javascript

    This parser helps you pull design tokens as JavaScript objects for all token types and their respective helper functions.

    Interface

    interface parser {
      name: 'to-javascript';
      output: {
        type: 'file';
        filePath: string;
      };
      options?: {
        typescript?: boolean;
        moduleExport?: 'es6' | 'commonjs';
      };
    }

    Basic usage

    {
      "colors": {
    
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "To JavaScript",
          "parsers": [
            {
              "name": "to-javascript",
              "output": {
                "type": "file",
                "filePath": "tokens.js"
              }
            }
          ]
        }
      ]
    }
    tokens.js
    /** 
    * @enum {string} All the valid paths for the collection colors.
    * Use it when calling `getColorsTokenByMode`
    */
    export const colorsColorPath = {
      'colors.Core.blue-100': 'colors.Core.blue-100',
      'colors.Core.blue-700': 'colors.Core.blue-700',
      'colors.semantic.background.button.primary.hover': 'colors.semantic.background.button.primary.hover'
    };
    
    /**
    * All the modes of the collection colors.
    * Use it when calling `getColorsTokenByMode`
    */
    export const colorsModes = [ 'light', 'dark' ];
    
    /** 
    * All the tokens of the collection colors.
    * Use `getColorsTokenByMode` to retrieve the tokens
    */
    export const colors = {
      'colors.Core.blue-100': { dark: 'rgb(229, 29, 29)', light: 'rgb(255, 255, 255)' },
      'colors.Core.blue-700': { dark: 'rgb(229, 0, 0)', light: 'rgb(255, 200, 255)' },
      'colors.semantic.background.button.primary.hover': { dark: 'rgb(229, 29, 29)', light: 'rgb(255, 200, 255)' }
    };
    
    /**
    * Retrieve a token for the collection 'colors'.
    * @param {keyof typeof colorsPath} path - The path to the token
    * @param {'light' | 'dark'} mode - The mode of the token you want to retrieve 
    * @returns {number | string} The value of a token for a given mode
    */
    export function getColorsTokenByMode(path, mode) {
      if (!colors[path]) {
        throw new Error("Path: '" + path + "' doesn't exist for collection 'colors'. Here are all the valid paths for each type:" + `
    - color:
        - colors.Core.blue-100
        - colors.Core.blue-700
        - colors.semantic.background.button.primary.hover`)
      }
    
      if (!colors[path][mode]) {
        throw new Error("Invalid mode '" + mode.toString() + "' for collection 'colors' at path '" + path + "', here are all the valid modes:\n- " + Object.keys(colors[path]).join('\n- '))
      }
    
      return colors[path][mode]
    }

    to-css-custom-properties

    This parser helps you transform design tokens into CSS Custom Properties.

    Interface

    interface parser {
      name: 'to-css-custom-properties';
      output: {
        type: 'file';
        filePath: string;
      };
      options?: {
        tokenNameTemplate?: string;
        selectorTemplate?: string;
        includeCoreTokensInScopes?: boolean;
      };
    }

    Options

    Parameter
    Required
    Type
    Default
    Description

    selectorTemplate

    A design token can have modes, be nested in groups and be part of a collection. The following use case will generate a single CSS file containing core tokens and semantic tokens.

    CSS Custom Properties

    This template is dedicated for Web developers using CSS. It helps you generate all types of design tokens as CSS Custom Properties in their respective CSS file.

    This example uses four different parsers:

    • filter to target on a specific collection named "Colors" that contains our colors

    • convert-color to convert our colors in HSL

    • to change the name of our tokens and modes to kebabCase

    • to generate a CSS file containing our tokens

    This template is an example among others. Head toward the page to get all available options.

    When using the CLI, you need to fill three properties:

    • repository is @organization/repository

    • personalAccessToken which you can generate

    • rules

    If you use the GitHub, you need to fill two properties:

    • repository is @organization/repository

    • rules lets you transform tokens by chaining parsers

    to-sdtf

    This parser helps you get your design tokens as a SDTF graph in JSON.

    REST API

    The Specify API lets you extend Specify functionalities beyond what we provide out of the box.

    The Specify API is based on REST structure. We support authentication via access tokens. Requests are made via HTTP endpoints with clear functions and appropriate response codes. Endpoints allow you to request design tokens and assets from a Specify repository.

    Specify's REST API is useful if you want to use design data coming from Specify through custom scripts like a Figma plugin or a .

    In short, our REST API helps you request design data through HTTP requests. Like with our you can use parsers to transform design data.

    However, you cannot directly generate files using the REST API as it only returns text. You'll have to write custom scripts to generate design files (e.g., colors.css).

    To sum things up, to generate files from Specify (e.g., colors.css

    "$collection": {
    "$modes": [
    "light",
    "dark"
    ]
    },
    "Core": {
    "blue-100": {
    "$type": "color",
    "$value": {
    "dark": {
    "red": 229,
    "blue": 29,
    "alpha": 1,
    "green": 29,
    "model": "rgb"
    },
    "light": {
    "red": 255,
    "blue": 255,
    "alpha": 1,
    "green": 255,
    "model": "rgb"
    }
    },
    "$description": "token 1 aliased with n modes within collection within n groups"
    },
    "blue-700": {
    "$type": "color",
    "$value": {
    "dark": {
    "red": 229,
    "blue": 0,
    "alpha": 1,
    "green": 0,
    "model": "rgb"
    },
    "light": {
    "red": 255,
    "blue": 255,
    "alpha": 1,
    "green": 200,
    "model": "rgb"
    }
    },
    "$description": "token 2 aliased with n modes within collection within n groups"
    }
    },
    "semantic": {
    "background": {
    "button": {
    "primary": {
    "hover": {
    "$type": "color",
    "$value": {
    "dark": {
    "$mode": "dark",
    "$alias": "colors.Core.blue-100"
    },
    "light": {
    "$mode": "light",
    "$alias": "colors.Core.blue-700"
    }
    },
    "$description": "alias token with n modes within collection within n groups"
    }
    }
    }
    }
    }
    }
    }
    "$collection": {
    "$modes": [
    "light",
    "dark"
    ]
    },
    "Core": {
    "blue-100": {
    "$type": "color",
    "$value": {
    "dark": {
    "red": 229,
    "blue": 29,
    "alpha": 1,
    "green": 29,
    "model": "rgb"
    },
    "light": {
    "red": 255,
    "blue": 255,
    "alpha": 1,
    "green": 255,
    "model": "rgb"
    }
    },
    "$description": "token 1 aliased with n modes within collection within n groups"
    },
    "blue-700": {
    "$type": "color",
    "$value": {
    "dark": {
    "red": 229,
    "blue": 0,
    "alpha": 1,
    "green": 0,
    "model": "rgb"
    },
    "light": {
    "red": 255,
    "blue": 255,
    "alpha": 1,
    "green": 200,
    "model": "rgb"
    }
    },
    "$description": "token 2 aliased with n modes within collection within n groups"
    }
    },
    "semantic": {
    "background": {
    "button": {
    "primary": {
    "hover": {
    "$type": "color",
    "$value": {
    "dark": {
    "$mode": "dark",
    "$alias": "colors.Core.blue-100"
    },
    "light": {
    "$mode": "light",
    "$alias": "colors.Core.blue-700"
    }
    },
    "$description": "alias token with n modes within collection within n groups"
    }
    }
    }
    }
    }
    }
    }

    convert-color

    This parser helps you convert the color formats of color compatible tokens over a SDTF graph.

    Example

    filter

    This parser helps you filter a SDTF graph.

    Example

    select-modes

    This parser helps you select design tokens from specific mode(s).

    Example

    to-css-custom-properties

    This parser helps you transform design tokens in CSS Custom Properties.

    Example

    to-sdtf

    This parser helps you get your design tokens as a SDTF graph in JSON.

    Example

    to-style-dictionary

    This parser helps you generate Style Dictionary raw token files for all your design tokens coming from Specify.

    Example

    to-tailwind

    This parser helps you generate a Tailwind theme from all your design tokens coming from Specify.

    Example

    to-javascript

    This parser helps you pull design tokens as JavaScript objects for all token types and their respective getter functions.

    Example

    to-json

    This parser helps you pull design tokens in JSON with token values in JSON or CSS.

    Example

    to-typescript

    This parser helps you pull design tokens as TypeScript objects for all token types and their respective getter functions.

    Example

    change-case
    Example

    optional

    string

    The pattern used to generate the CSS selector name(s). It must match mustache template syntax. You can use collection, mode and groups names.

    tokenNameTemplate

    optional

    string

    The pattern used to generate token names. It must match mustache template syntax. You can use collection, mode,groups and token names.

    includeCoreTokensInScopes

    optional

    boolean

    false

    When set to true, you will have both core tokens and alias tokens in each CSS scopes thus making alias tokens always resolvable.

    Basic usage

    Head towards our templates section to see how you can use this parser with others to suit a common use case when working with CSS.

    lets you transform tokens by chaining parsers

    CLI configuration

    GitHub configuration

    Make sure you have connected your GitHub account with your Specify account. Head toward this article to learn more.

    change-case
    to-css-custom-properties
    to-css-custom-properties
    in your account settings

    Interface

    Basic usage

    {
      "colors": {
        "$collection": {
          "$modes": [
            "light",
            "dark"
          ]
        },
        "Core": {
          "blue-100": {
            "$type": "color",
            "$value": {
              "dark": {
                "red": 229,
                "blue": 29,
                "alpha": 1,
                "green": 29,
                "model": "rgb"
              },
              "light": {
                "red": 255,
                "blue": 255,
                "alpha": 1,
                "green": 255,
                "model": "rgb"
              }
            },
            "$description": "token 1 aliased with n modes within collection within n groups"
          },
          "blue-700": {
            "$type": "color",
            "$value": {
              "dark": {
                "red": 229,
                "blue": 0,
                "alpha": 1,
                "green": 0,
                "model": "rgb"
              },
              "light": {
                "red": 255,
                "blue": 255,
                "alpha": 1,
                "green": 200,
                "model": "rgb"
              }
            },
            "$description": "token 2 aliased with n modes within collection within n groups"
          }
        },
        "semantic": {
          "background": {
            "button": {
              "primary": {
                "hover": {
                  "$type": "color",
                  "$value": {
                    "dark": {
                      "$mode": "dark",
                      "$alias": "colors.Core.blue-100"
                    },
                    "light": {
                      "$mode": "light",
                      "$alias": "colors.Core.blue-700"
                    }
                  },
                  "$description": "alias token with n modes within collection within n groups"
                }
              }
            }
          }
        }
      }
    }
    {
      "colors": {
        "$collection": { "$modes": ["Light", "Dark"] },
        "core": {
          "blue-100": {
            "$type": "color",
            "$description": "token 1 aliased with n modes within collection within n groups",
            "$value": {
              "Light": {
                "red": 219,
                "blue": 254,
                "alpha": 1,
                "green": 236,
                "model": "rgb"
              },
              "Dark": {
                "red": 41,
                "blue": 67,
                "alpha": 1,
                "green": 52,
                "model": "rgb"
              }
            }
          },
          "blue-700": {
            "$type": "color",
            "$description": "token 2 aliased with n modes within collection within n groups",
            "$value": {
              "Light": {
                "red": 17,
                "blue": 249,
                "alpha": 1,
                "green": 125,
                "model": "rgb"
              },
              "Dark": {
                "red": 96,
                "blue": 250,
                "alpha": 1,
                "green": 168,
                "model": "rgb"
              }
            }
          }
        },
        "semantic": {
          "background": {
            "button": {
              "primary": {
                "hover": {
                  "$type": "color",
                  "$description": "alias token with n modes within collection within n groups",
                  "$value": {
                    "Dark": {
                      "$mode": "Dark",
                      "$alias": "colors.core.blue-100"
                    },
                    "Light": {
                      "$mode": "Light",
                      "$alias": "colors.core.blue-700"
                    }
                  }
                }
              }
            }
          }
        }  
      }
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Generate tokens as CSS Custom Properties",
          "parsers": [
            {
              "name": "to-css-custom-properties",
              "output": {
                "type": "file",
                "filePath": "tokens.css"
              },
              "options": {
                "tokenNameTemplate": "--{{groups}}-{{token}}",
                "selectorTemplate": "[data-theme=\"{{mode}}\"]",
                "includeCoreTokensInScopes": true
              }
            }
          ]
        }
      ]
    }
    tokens.css
    [data-theme="dark"] {
      --core-blue-100: rgb(41, 52, 67);
      --core-blue-700: rgb(96, 168, 250);
      --semantic-background-button-primary-hover: var(--core-blue-100);
    }
    [data-theme="light"] {
      --core-blue-100: rgb(219, 236, 254);
      --core-blue-700: rgb(17, 125, 249);
      --semantic-background-button-primary-hover: var(--core-blue-700);
    }
    {
      "version": "2",
      "repository": "@organization/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "css",
          "parsers": [
            {
              "name": "filter",
              "options": {
                "query": {
                  "where": {
                    "collection": "Colors",
                    "select": {
                      "parents": true,
                      "children": true
                    }
                  }
                }
              }
            },
            {
              "name": "convert-color",
              "options": {
                "toFormat": "hsl",
                "applyTo": {
                  "collection": true
                }
              }
            },
            {
              "name": "change-case",
              "options": {
                "change": "names",
                "toCase": "kebabCase",
                "applyTo": {
                  "collection": true
                }
              }
            },
            {
              "name": "change-case",
              "options": {
                "change": "modes",
                "toCase": "kebabCase",
                "applyTo": {
                  "collection": true
                }
              }
            },
            {
              "name": "to-css-custom-properties",
              "output": {
                "type": "file",
                "filePath": "tokens.css"
              }
            }
          ]
        }
      ]
    }
    {
      "version": "2",
      "repository": "@organization/repository",
      "rules": [
        {
          "name": "css",
          "parsers": [
            {
              "name": "filter",
              "options": {
                "query": {
                  "where": {
                    "collection": "Colors",
                    "select": {
                      "parents": true,
                      "children": true
                    }
                  }
                }
              }
            },
            {
              "name": "convert-color",
              "options": {
                "toFormat": "hsl",
                "applyTo": {
                  "collection": true
                }
              }
            },
            {
              "name": "change-case",
              "options": {
                "change": "names",
                "toCase": "kebabCase",
                "applyTo": {
                  "collection": true
                }
              }
            },
            {
              "name": "change-case",
              "options": {
                "change": "modes",
                "toCase": "kebabCase",
                "applyTo": {
                  "collection": true
                }
              }
            },
            {
              "name": "to-css-custom-properties",
              "output": {
                "type": "file",
                "filePath": "tokens.css"
              }
            }
          ]
        }
      ]
    }
    interface parser {
      name: 'to-sdtf';
      output:
        | { type: 'directory'; directoryPath: string }
        | { type: 'file'; filePath: string }
        | { type: 'SDTF' }
        | { type: 'text' }
        | { type: 'JSON'; filePath: string };
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Generate tokens in JSON",
          "parsers": [
            {
              "name": "to-sdtf",
              "output": {
                "type": "file",
                "filePath": "output/tokens.json"
              }
            }
          ]
        }
      ]
    }
    tokens.json
    {
      "colors": {
        "$collection": {
          "$modes": [
            "light",
            "dark"
          ]
        },
        "Core": {
          "blue-100": {
            "$type": "color",
            "$value": {
              "dark": {
                "red": 229,
                "blue": 29,
                "alpha": 1,
                "green": 29,
                "model": "rgb"
              },
              "light": {
                "red": 255,
                "blue": 255,
                "alpha": 1,
                "green": 255,
                "model": "rgb"
              }
            },
            "$description": "token 1 aliased with n modes within collection within n groups"
          },
          "blue-700": {
            "$type": "color",
            "$value": {
              "dark": {
                "red": 229,
                "blue": 0,
                "alpha": 1,
                "green": 0,
                "model": "rgb"
              },
              "light": {
                "red": 255,
                "blue": 255,
                "alpha": 1,
                "green": 200,
                "model": "rgb"
              }
            },
            "$description": "token 2 aliased with n modes within collection within n groups"
          }
        },
        "semantic": {
          "background": {
            "button": {
              "primary": {
                "hover": {
                  "$type": "color",
                  "$value": {
                    "dark": {
                      "$mode": "dark",
                      "$alias": "colors.Core.blue-100"
                    },
                    "light": {
                      "$mode": "light",
                      "$alias": "colors.Core.blue-700"
                    }
                  },
                  "$description": "alias token with n modes within collection within n groups"
                }
              }
            }
          }
        }
      }
    }
    or
    icon.svg
    ) containing design tokens or assets use the
    or our
    .

    Specify provides the following endpoint to help you get design tokens and assets from a Specify repository.

    https://api.specifyapp.com/repository/{workspace}/{repository}/design-tokens

    POST https://api.specifyapp.com/repository/{workspace}/{repository}/design-tokens

    Get design tokens and assets from a Specify repository.

    Name
    Type
    Description

    workspace*

    String

    The name of your organization in Specify.

    For instance, in this URL https://specifyapp.com/@specifyapp/Seeds/color the workspace is "@specifyapp".

    name*

    String

    Name
    Type
    Description

    filter

    Object

    Set all the you want to target.

    "filter": { "types": [ "color", "font", "textStyle" ] }

    parsers

    Object or Array

    {
        // Response
    }
    {
        // Response
    }
    {
        // Response
    }
    {
        // Response
    }
    {
        // Response
    }

    Once you have your personal access token, you can pass it within the Authorization header of your request.

    Here's a simple example to get colors in CSS variables from a repository called all-design-datain the @acme-inc workspace:

    Specify uses standard HTTP response codes for success and failure notifications. Our errors are further classified by type. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted). Codes in the 5xx range indicate an error with Specify servers.

    Some 4xx errors that could be handled programmatically include an error code that briefly explains the error reported.

    Property
    Type
    Description

    type

    string

    The type of error returned. One of api_connection_error, api_error, authentication_error, invalid_request_error, or rate_limit_error.

    statusCode

    Introduction

    What you can do with the REST API

    Raycast script
    CLI
    Overview of the possibilities offered by the Specify API
    curl -X POST 'https://api.specifyapp.com/repository/@acme-inc/all-design-data/design-tokens' \
      -H 'Authorization: <your-personal-access-token>' \
      -H 'Content-Type: application/json' \
      -d '{"filter": { "types": ["color"]}, "parsers": [{"name": "to-css-custom-properties"}]}'

    Endpoint

    Parameters

    Path Parameters

    Request Body

    Example

    Errors

    Attributes

    CLI
    GitHub application

    to-react-native

    This parser helps you pull design tokens as a theme compatible with React Native and their respective helper functions.

    Interface

    interface parser {
      name: 'to-react-native';
      output: {
        type: 'file';
        filePath: string;
      };
      options?: {
        typescript?: boolean;
        moduleExport?: 'es6' | 'commonjs';
      };
    }

    Basic usage

    {
      "colors": {
    
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "To React Native theme",
          "parsers": [
            {
              "name": "to-react-native",
              "output": {
                "type": "file",
                "filePath": "public/theme.js"
              }
            }
          ]
        }
      ]
    }
    tokens.js
    /** 
    * @typedef {'primitive.spacing.1'} DimensionPath - All the valid paths for the tokens of type dimension.
    * To use this type you can do: `@type {import('path/to/myTokensFile').DimensionPath}`
    */
    /** 
    * @typedef {'themedColor.highEmphasis'} ColorPath - All the valid paths for the tokens of type color.
    * To use this type you can do: `@type {import('path/to/myTokensFile').ColorPath}`
    */
    /**
    * @typedef {DimensionPath | ColorPath} AllPath - All possible paths
    */
    /**
    * @typedef {typeof pathsByType} PathsByType - All the paths for a given token type. Needed for `getTokensByType`
    */
    const pathsByType = /** @type {const} */ ({
      dimension: [ 'primitive.spacing.1' ],
      color: [ 'themedColor.highEmphasis' ]
    });
    
    /**
    * @typedef {typeof colorModes[number]} ColorModes - All the valid modes of color.
    * To use this type you can do: `@type {import('path/to/myTokensFile').ColorModes}`
    */
    export const colorModes = /** @type {const} */ ([ 'dark', 'light' ]);
    
    /**
    * @typedef {typeof themedColorModes[number]} ThemedcolorModes - All the valid modes of themedColor.
    * To use this type you can do: `@type {import('path/to/myTokensFile').ThemedcolorModes}`
    */
    export const themedColorModes = /** @type {const} */ ([ 'light', 'dark' ]);
    
    /**
    @typedef {ColorModes | ThemedcolorModes} AllMode - All the available modes
    */
    
    /** 
    * @typedef {typeof tokens} Tokens - All the tokens. 
    * Use `getTokenByMode` to retrieve one. 
    */
    export const tokens = /** @type {const} */ ({
      'primitive.spacing.1': '4px',
      'themedColor.highEmphasis': { dark: '#ffffff', light: '#000000' }
    });
    
    /**
    * Retrieve any token for a given mode. If available, the default mode will be: 'default'
    * @template {AllPath} Path - A generic extending all the possible paths
    * @template {Tokens[Path] extends Record<string, any>
        ? keyof Tokens[Path]
        : undefined} Mode - A generic representing all the valid modes for a given path
    * @template {Tokens[Path] extends Record<string, any>
        ? Tokens[Path][Mode extends undefined ? never : Mode]
        : Tokens[Path]} Return - The return type
    * @param {Path} path - The path to the token
    * @param {Mode} mode - The mode of the token you want to retrieve 
    * @returns {Return} - The value of a token for a given mode
    */
    export function getTokenByMode(path, mode) {
      if (!tokens[path]) {
        throw new Error("Path: '" + path + "' doesn't exist. Here are all the valid paths:\n- " + Object.keys(tokens).join('\n- '))
      }
    
      if (typeof tokens[path] !== 'object') {
        return tokens[path] ;
      }
    
      if (!mode) throw new Error('Mode is undefined but it should be one of ' + Object.keys(tokens[path]).join(', ') + ' for path: ' + path);
    
      if (!tokens[path][mode]) {
        throw new Error("Invalid mode '" + mode.toString() + " at path '" + path + "', here are all the valid modes:\n- " + Object.keys(tokens[path]).join('\n- '))
      } 
    
      return tokens[path][mode]  
    }
    
    /**
    * Retrieve all the tokens for a specific type (color, dimension, etc...).
    * Note that the value will either be a string or an object if the token has modes
    * @template {keyof PathsByType} Type - A generic extending all the possible types
    * @template {Tokens[PathsByType[Type][number]]} Token - A generic representing a union of all the outputs
    * @param {Type} type - The path to the token
    * @returns {Array<Token>} - An array with all the values
    */
    export function getTokensByType(type) {
      if (!pathsByType[type]) {
        throw new Error('The type: \'' + type + '\' does not exist')
      }
    
      return pathsByType[type].map(path => tokens[path]);
    }

    convert-dimension

    This parser helps you convert units of dimension tokens.

    Interface

    interface parser {
      name: 'convert-dimension';
      options: {
        toFormat: '%' | 'px' | 'em' | 'rem' | 'pt' | 'pc' | 'in' | 'cm' | 'mm' | 'ex' | 'cap' | 'ch' | 'ic' | 'lh' | 'rlh' | 'vw' | 'svw' | 'lvw' | 'dvw' | 'vh' | 'svh' | 'lvh' | 'dvh' | 'vi' | 'svi' | 'lvi' | 'dvi' | 'vb' | 'svb' | 'lvb' | 'dvb' | 'vmin' | 'svmin' | 'lvmin' | 'dvmin' | 'vmax' | 'svmax' | 'lvmax' | 'dvmax'
        baseValue?: {
          rem?: number
        }
        applyTo?: SDTFQuery,
      };
    }

    Options

    Parameter
    Required
    Type
    Default
    Description

    toFormat

    We convert all colors from our SDTF graph in hsl.

    We then generate our transformed SDTF graph in a JSON file thanks to the parser.

    to-style-dictionary

    This parser helps you generate Style Dictionary raw token files for all your design tokens coming from Specify.

    Unlike the existing to-style-dictionary parser, this one doesn't have any options yet.

    Interface

    interface parser {
      name: 'to-style-dictionary';
      output: {
        type: 'directory';
        directoryPath: string;
      };
    }

    General output rules

    • A collection will generate a folder at the top level

      1. The default level refers to the SDTF Token Type associated SD Category → {collectionName?}/{SDCategory}

      2. The next folder level is the name of the potential first group containing the token → {collectionName?}/{SDCategory}/{1stLevelGroupName?}

      3. The default filename is the name of the first group, or the name of the each mode the token might have, or base.json → {collectionName?}/{SDCategory}/{ mode? | 1stLevelGroupName? | base}.json (priority order for filename: groupName > mode > base)

    • The token path inside the file must match the token file path with the following priority order: collection > SDCategoryType > Mode > Groups

      • {collectionName?}/{SDCategory}/{1stLevelGroupName? | mode? | base}.json

    "$collection": {
    "$modes": [
    "light",
    "dark"
    ]
    },
    "Core": {
    "blue-100": {
    "$type": "color",
    "$value": {
    "dark": {
    "red": 229,
    "blue": 29,
    "alpha": 1,
    "green": 29,
    "model": "rgb"
    },
    "light": {
    "red": 255,
    "blue": 255,
    "alpha": 1,
    "green": 255,
    "model": "rgb"
    }
    },
    "$description": "token 1 aliased with n modes within collection within n groups"
    },
    "blue-700": {
    "$type": "color",
    "$value": {
    "dark": {
    "red": 229,
    "blue": 0,
    "alpha": 1,
    "green": 0,
    "model": "rgb"
    },
    "light": {
    "red": 255,
    "blue": 255,
    "alpha": 1,
    "green": 200,
    "model": "rgb"
    }
    },
    "$description": "token 2 aliased with n modes within collection within n groups"
    }
    },
    "semantic": {
    "background": {
    "button": {
    "primary": {
    "hover": {
    "$type": "color",
    "$value": {
    "dark": {
    "$mode": "dark",
    "$alias": "colors.Core.blue-100"
    },
    "light": {
    "$mode": "light",
    "$alias": "colors.Core.blue-700"
    }
    },
    "$description": "alias token with n modes within collection within n groups"
    }
    }
    }
    }
    }
    }
    }

    The name of the Specify repository containing the design data you're requesting.

    For instance, in this URL https://specifyapp.com/@specifyapp/Seeds/color the repository is "Seeds".

    Can contain an object or an array of objects. Each object corresponds to a specific parser.

    string

    For some errors that could be handled programmatically, a short string indicating the error code reported.

    message

    string

    A human-readable message providing more details about the error.

    validation

    string

    All invalid query / payload parameters. All invalid query / payload parameters. This property will be displayed on specific endpoints error response.

    Token types

    required

    The target color format to convert to. Actual value conversion is done by the colord package.

    baseValue

    optional

    applyTo

    optional

    The selection where to apply the transformation. collection, group, token take a Regex string or true to select anything of the kind. An SDTFQuery can be used for advance use cases. Learn more about how to query your SDTF graph.

    Basic usage

    to-sdtf
    →
    { collection: {type: {mode: { groupName: { tokenName: ... }}}}

    Basic usage

    | '%' 
    | 'px' 
    | 'em' 
    | 'rem' 
    | 'pt' 
    | 'pc' 
    | 'in' 
    | 'cm' 
    | 'mm' 
    | 'ex' 
    | 'cap' 
    | 'ch' 
    | 'ic' 
    | 'lh' 
    | 'rlh' 
    | 'vw' 
    | 'svw' 
    | 'lvw' 
    | 'dvw' 
    | 'vh' 
    | 'svh' 
    | 'lvh' 
    | 'dvh' 
    | 'vi' 
    | 'svi' 
    | 'lvi' 
    | 'dvi' 
    | 'vb' 
    | 'svb' 
    | 'lvb' 
    | 'dvb' 
    | 'vmin' 
    | 'svmin' 
    | 'lvmin' 
    | 'dvmin' 
    | 'vmax' 
    | 'svmax' 
    | 'lvmax' 
    | 'dvmax'
    { rem: number }
    | { collection: string | true }
    | { group: string | true }
    | { token: string | true }
    | SDTFQuery
    { token: true }
    {
      "Foundation": {
        "spacing": {
          "1": {
            "$type": "dimension",
            "$value": {
              "default": {
                "value": 4,
                "unit": "px"
              }
            }
          },
          "2": {
            "$type": "dimension",
            "$value": {
              "default": {
                "value": 8,
                "unit": "px"
              }
            }
          },
          "3": {
            "$type": "dimension",
            "$value": {
              "default": {
                "value": 12,
                "unit": "px"
              }
            }
          }
        }
      }
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Convert spacing in rem and generate tokens in JSON",
          "parsers": [
            {
              "name": "convert-dimension",
              "options": {
                "toFormat": "rem"
              }
            },
            {
              "name": "to-sdtf",
              "output": {
                "type": "file",
                "filePath": "tokens.json"
              }
            }
          ]
        }
      ]
    }
    tokens.json
    {
      "Foundation": {
        "spacing": {
          "1": {
            "$type": "dimension",
            "$value": {
              "default": {
                "value": 0.25,
                "unit": "rem"
              }
            }
          },
          "2": {
            "$type": "dimension",
            "$value": {
              "default": {
                "value": 0.5,
                "unit": "rem"
              }
            }
          },
          "3": {
            "$type": "dimension",
            "$value": {
              "default": {
                "value": 0.75,
                "unit": "rem"
              }
            }
          }
        }
      }
    }
    {
      "colors": {
        "$collection": { "$modes": ["light", "dark"] },
        "core": {
          "blue-100": {
            "$type": "color",
            "$description": "token 1 aliased with n modes within collection within n groups",
            "$value": {
              "light": {
                "red": 255,
                "blue": 255,
                "alpha": 1,
                "green": 255,
                "model": "rgb"
              },
              "dark": {
                "red": 229,
                "blue": 29,
                "alpha": 1,
                "green": 29,
                "model": "rgb"
              }
            }
          },
          "blue-700": {
            "$type": "color",
            "$description": "token 2 aliased with n modes within collection within n groups",
            "$value": {
              "light": {
                "red": 255,
                "blue": 255,
                "alpha": 1,
                "green": 200,
                "model": "rgb"
              },
              "dark": {
                "red": 229,
                "blue": 0,
                "alpha": 1,
                "green": 0,
                "model": "rgb"
              }
            }
          }
        },
        "semantic": {
          "background": {
            "button": {
              "primary": {
                "hover": {
                  "$type": "color",
                  "$description": "alias token with n modes within collection within n groups",
                  "$value": {
                    "dark": {
                      "$mode": "dark",
                      "$alias": "colors.core.blue-100"
                    },
                    "light": {
                      "$mode": "light",
                      "$alias": "colors.core.blue-700"
                    }
                  }
                }
              }
            }
          }
        }  
      }
    }
    
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Generate Style Dictionary raw token files",
          "parsers": [
            {
              "name": "to-style-dictionary",
              "output": {
                "type": "directory",
                "directoryPath": "output/tokens/"
              }
            }
          ]
        }
      ]
    }
    color/light/core.json
    {
      "colors": {
        "color": {
          "light": {
            "core": {
              "blue-100": {
                "value": "rgb(255, 255, 255)",
                "type": "color",
                "description": "token 1 aliased with n modes within collection within n groups"
              },
              "blue-700": {
                "value": "rgb(255, 200, 255)",
                "type": "color",
                "description": "token 2 aliased with n modes within collection within n groups"
              }
            }
          }
        }
      }
    }
    color/dark/core.json
    {
      "colors": {
        "color": {
          "dark": {
            "core": {
              "blue-100": {
                "value": "rgb(229, 29, 29)",
                "type": "color",
                "description": "token 1 aliased with n modes within collection within n groups"
              },
              "blue-700": {
                "value": "rgb(229, 0, 0)",
                "type": "color",
                "description": "token 2 aliased with n modes within collection within n groups"
              }
            }
          }
        }
      }
    }
    color/light/semantic.json
    {
      "colors": {
        "color": {
          "light": {
            "semantic": {
              "background": {
                "button": {
                  "primary": {
                    "hover": {
                      "value": "{colors.color.light.core.blue-700}",
                      "type": "color",
                      "description": "alias token with n modes within collection within n groups"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }

    Tokens Studio

    In this guide you’ll learn how to sync your design tokens from Tokens Studio to your Specify repository and how to keep them updated.

    Before getting started

    To get the most out of this guide, you will need:

    • A Specify account

    • The Tokens Studio plugin installed in your Figma

    • A , , , or account

    Specify automatically fetches design tokens through the JSON file created by Tokens Studio. The best way to keep your design tokens in sync with both tools is to host your JSON file in a repository like GitHub.

    1. Head to your Tokens Studio plugin in Figma

    2. Within the settings tab, add a new sync provider

    3. Commit your Tokens Studio JSON file to your repository

    1. Go to your Specify workspace

    2. Click on "Create repository"

    3. Choose "Advanced Repository"

    4. Name your repository

    At this point, you have two ways to sync your JSON file. Either with a public hosting link or a private one. We will go through both options below.

    1. In the "Source" tab, click on "Create a source"

    2. Select "Remote URL"

    3. Select "Public"

    4. Name your source

    Your JSON file is now detected as a source and your design tokens appear within your repository.

    On the opposite of the public URL, Specify will ask you for some additional information so its system is able to fetch your file. Let’s see how to proceed with the main versioning tools:

    Requirements:

    • Have a GitHub account

    • Have an Advanced Repository created

    • Have a JSON file containing design tokens from Tokens Studio

    To add a private URL source from GitHub to Specify:

    1. In the "Source" tab of your Specify repository, click on "Create a source"

    2. Select "Remote URL"

    3. Select "Private"

    4. Name your source

    Requirements:

    • Have an Azure DevOps account

    • Have a Project containing a repository

    • Have a JSON file containing design tokens from Tokens Studio

    To add a private URL source from Azure DevOps to Specify:

    1. In the "Source" tab of your Specify repository, click on "Create a source"

    2. Select "Remote URL"

    3. Select "Private"

    4. Name your source

    Requirements:

    • Have a GitLab account

    • Have an Advanced Repository created

    • Have a JSON file containing design tokens from Tokens Studio

    To add a private URL source from GitLab to Specify:

    1. In the "Source" tab of your Specify repository, click on "Create a source"

    2. Select "Remote URL"

    3. Select "Private"

    4. Give a name

    Requirements:

    • Have a JSONBin account

    • Have an Advanced Repository created

    • Have a bin with a JSON file containing design tokens from Tokens Studio

    To add a private URL source from JSONBin to Specify:

    1. In the "Source" tab of your Specify repository, click on "Create a source"

    2. Select "Remote URL"

    3. Select "Private"

    4. Name your source

    After adding your source. All you have to do is to:

    1. Go to the "Source" tab of your Specify repository

    2. Click on the context menu next to your source

    3. Click on "sync"

    Your source is now updated!

    Please keep in mind Specify is yet not compatible with the following data coming from Tokens Studio:

    • Composition

    • Assets (bitmap & vectors)

    • Color manipulation (gradients, alpha, darken, lighten & mix)

    They will be released in future updates. However, if you have urgent needs for Specify to be compatible with one of them, .

    convert-color

    This parser helps you convert color formats of color tokens.

    Interface

    interface parser {
      name: 'convert-color';
      options: {
        toFormat:
          | 'hex'
          | 'rgb'
          | 'hsl'
          | 'hsb'
          | 'lch'
          | 'lab';
        applyTo?:
          | { collection: string | true }
          | { group: string | true }
          | { token: string | true }
          | SDTFQuery;
      };
    }

    Options

    Parameter
    Required
    Type
    Default
    Description

    toFormat

    We convert all colors from our SDTF graph in hsl.

    We then generate our transformed SDTF graph in a JSON file thanks to the parser.

    filter

    This parser helps you filter a SDTF graph.

    Interface

    interface parser {
      name: 'filter';
      options: {
        query: SDTFQuery;
        resolveAliases?: boolean;
        allowUnresolvableAliases?: boolean;
        deduplicate: true | undefined;
        failOnMutate: true | undefined;
      };
    }

    Options

    Parameter
    Required
    Type
    Default
    Description

    query

    1. We want to get all tokens in all groups named "info"

    2. We also want to get the parent collection...

    3. ... and all children tokens within the "info" group(s)

    Querying a SDTF graph

    Learn more about how to query your SDTF token graph.

    Your token system can be more complex than it seems. You will often need to interact with your token graph to transform a specific set of design tokens within a Specify configuration.

    This article will help you understand how you can query your token graph to select a specific set of tokens.

    You'll need to query your graph when using the following parsers:

    change-case

    This parser helps you change the case of names or modes over a SDTF graph.

    Parameter
    Required
    Type
    Default
    Description

    required

    The target color format to convert to. Actual value conversion is done by the colord package.

    applyTo

    optional

    The selection where to apply the transformation. collection, group, token take a Regex string or true to select anything of the kind. An SDTFQuery can be used for advance use cases. Learn more about how to query your SDTF graph.

    Basic usage

    to-sdtf
  • We eventually generate our transformed SDTF graph in a JSON file thanks to the to-sdtf parser.

  • required

    SDTFQuery

    The query that select items in the graph. Learn more about how to query your SDTF graph.

    resolveAliases

    optional

    boolean

    false

    Whether to resolve the aliases of the graph. Thus, preventing aliases to become unresolvable when their source is not included in the selected items.

    allowUnresolvableAliases

    optional

    boolean

    true

    Whether to allow unresolvable aliases to flow through. This option is only available when resolveAliases = true

    deduplicate

    optional

    true | undefined

    undefined

    When you target tokens from different areas in your graph you can end up with tokens that will have the same name which will lead to an override. When set to true, this option will suffix tokens with a -{number} to prevent the override.

    failOnMutate

    optional

    true | undefined

    undefined

    By default, this parser mutates your graph. When set to true this option will make your pipeline return an error when your tokens respective path differ from their original one in the graph. Set this option to true if you want to be 100% aligned between design and code.

    Basic usage: select all tokens from a group in a collection

    convert-color

  • convert-dimension

  • Every Query holds a single a where property being an object, to select one branch of the graph, or an array of objects, to select many branches of the graph (OR statement).

    The where property splits in 3 kinds: token, group, collection - offering a dedicated set of options to match against the given kind.

    The name property accepts a RegExp for a value. These resources will help you debug your regular expressions:

    • https://regex101.com/

    • https://regexr.com/

    Introduction

    Compatible parsers

    filter
    change-case

    Query structure

    Where Token

    Where Group

    Where Collection

    Use cases

    Select tokens from a specific collection

    Select tokens from several collections matching a naming pattern

    Select tokens from a specific group

    Select tokens of a specific type from a collection

    Select all tokens from a collection and from groups matching a naming pattern

    Select tokens from several groups with different names

    | 'hex' 
    | 'rgb' 
    | 'hsl' 
    | 'hsb' 
    | 'lch' 
    | 'lab'
    | { collection: string | true }
    | { group: string | true }
    | { token: string | true }
    | SDTFQuery
    { token: true }
    {
      "Colors": {
        "$collection": { "$modes": ["Light", "Dark"] },
        "Core": {
          "blue 100": {
            "$type": "color",
            "$description": "token 1 aliased with n modes within collection within n groups",
            "$value": {
              "Light": {
                "red": 219,
                "blue": 254,
                "alpha": 1,
                "green": 236,
                "model": "rgb"
              },
              "Dark": {
                "red": 41,
                "blue": 67,
                "alpha": 1,
                "green": 52,
                "model": "rgb"
              }
            }
          },
          "blue 700": {
            "$type": "color",
            "$description": "token 2 aliased with n modes within collection within n groups",
            "$value": {
              "Light": {
                "red": 17,
                "blue": 249,
                "alpha": 1,
                "green": 125,
                "model": "rgb"
              },
              "Dark": {
                "red": 96,
                "blue": 250,
                "alpha": 1,
                "green": 168,
                "model": "rgb"
              }
            }
          }
        },
        "semantic": {
          "background": {
            "button": {
              "primary": {
                "hover": {
                  "$type": "color",
                  "$description": "alias token with n modes within collection within n groups",
                  "$value": {
                    "Dark": {
                      "$mode": "dark",
                      "$alias": "Colors.Core.blue 100"
                    },
                    "Light": {
                      "$mode": "light",
                      "$alias": "Colors.Core.blue 700"
                    }
                  }
                }
              }
            }
          }
        }  
      }
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Convert colors in HSL and generate tokens in JSON",
          "parsers": [
            {
              "name": "convert-color",
              "options": {
                "toFormat": "hsl"
              }
            },
            {
              "name": "to-sdtf",
              "output": {
                "type": "file",
                "filePath": "tokens.json"
              }
            }
          ]
        }
      ]
    }
    tokens.json
    {
      "colors": {
        "$collection": { "$modes": ["light", "dark"] },
        "core": {
          "blue-100": {
            "$type": "color",
            "$description": "token 1 aliased with n modes within collection within n groups",
            "$value": {
              "light": {
                "model": "hsl",
                "hue": 211,
                "saturation": 95,
                "lightness": 93,
                "alpha": 1
              },
              "dark": {
                "model": "hsl",
                "hue": 215,
                "saturation": 24,
                "lightness": 21,
                "alpha": 1
              }
            }
          },
          "blue-700": {
            "$type": "color",
            "$description": "token 2 aliased with n modes within collection within n groups",
            "$value": {
              "light": {
                "model": "hsl",
                "hue": 212,
                "saturation": 95,
                "lightness": 52,
                "alpha": 1
              },
              "dark": {
                "model": "hsl",
                "hue": 212,
                "saturation": 94,
                "lightness": 68,
                "alpha": 1
              }
            }
          }
        },
        "semantic": {
          "background": {
            "button": {
              "primary": {
                "hover": {
                  "$type": "color",
                  "$description": "alias token with n modes within collection within n groups",
                  "$value": {
                    "dark": {
                      "$mode": "dark",
                      "$alias": "colors.core.blue-100"
                    },
                    "light": {
                      "$mode": "light",
                      "$alias": "colors.core.blue-700"
                    }
                  }
                }
              }
            }
          }
        }  
      }
    }
    tokens.json
    {
      "colors": {
        "$collection": {
          "$modes": ["light", "dark"]
        },
        "info": {
          "infoToken": {
            "$type": "color",
            "$value": {
              "light": {
                "model": "rgb",
                "red": 219,
                "green": 234,
                "blue": 254,
                "alpha": 1
              },
              "dark": {
                "model": "rgb",
                "red": 219,
                "green": 234,
                "blue": 254,
                "alpha": 1
              }
            }
          }
        }
      }
    }
    {
      "colors": {
        "$collection": {
          "$modes": ["light", "dark"]
        },
        "info": {
          "infoToken": {
            "$type": "color",
            "$value": {
              "light": {
                "model": "rgb",
                "red": 219,
                "green": 234,
                "blue": 254,
                "alpha": 1
              },
              "dark": {
                "model": "rgb",
                "red": 219,
                "green": 234,
                "blue": 254,
                "alpha": 1
              }
            }
          }
        },
        "danger": {
          "dangerToken": {
            "$type": "color",
            "$value": {
              "light": {
                "model": "rgb",
                "red": 209,
                "green": 204,
                "blue": 204,
                "alpha": 1
              },
              "dark": {
                "model": "rgb",
                "red": 19,
                "green": 34,
                "blue": 54,
                "alpha": 1
              }
            }
          }
        }
      }
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Only get tokens from a group named 'info' and gererate tokens in JSON",
          "parsers": [
            {
              "name": "filter",
              "options": {
                "query": {
                  "where": {
                    "group": "info",
                    "select": {
                      "parents": true,
                      "children": true
                    }
                  }
                }
              }
            },
            {
              "name": "to-sdtf",
              "output": {
                "type": "file",
                "filePath": "tokens.json"
              }
            }
          ]
        }
      ]
    }
    Type Query = { where: Where | Array<Where> }
    type WhereToken = {
      token: 
        | string
        | {
          name?: string;
          description?: string?;
        }
      select: 
        | true
        | {
          token?: boolean;
          parents?:
            | true
            | {
              groups?: true;
              collections?: true;
            }
        }
    }
    type WhereGroup = {
      group: string;
      select: 
        | true
        | {
          group?: boolean;
          parents?:
            | true
            | {
              groups?: true;
              collections?: true;
            }
          children:
            | true
            | {
              groups?: true;
              collections?: true;
              tokens?: true;
            }
        }
    }
    type WhereCollection = {
      collection: string;
      select: 
        | true
        | {
          collection?: boolean;
          parents?:
            | true
            | {
              groups?: true;
            }
          children:
            | true
            | {
              groups?: true;
              tokens?: true;
            }
        }
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Get tokens from collection named 'Colors'",
          "parsers": [
            {
              "name": "filter",
              "options": {
                "query": {
                  "where": {
                    "collection": "^Colors$",
                    "select": {
                      "parents": true,
                      "children": true
                    }
                  }
                }
              }
            }
          ]
        }
      ]
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Get tokens from all collections whose names contain 'colors'",
          "parsers": [
            {
              "name": "filter",
              "options": {
                "where": {
                  "collection": "colors",
                  "select": {
                    "collection": true,
                    "children": {
                      "tokens": true
                    }
                  }
                }
              }
            }
          ]
        }
      ]
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Get tokens from all groups named 'brand'",
          "parsers": [
            {
              "name": "filter",
              "options": {
                "query": {
                  "where": {
                    "group": "^brand$",
                    "select": {
                      "parents": true,
                      "children": true
                    }
                  }
                }
              }
            }
          ]
        }
      ]
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Get color tokens from the 'Android' collection",
          "parsers": [
            {
              "name": "filter",
              "options": {
                "where": {
                  "collection": "^Android$",
                  "andWhere": {
                    "token": ".*",
                    "withTypes": { "include": ["color"] },
                    "select": {
                      "token": true,
                      "parents": {
                        "collections": true
                      }
                    }
                  }
                }
              }
            }
          ]
        }
      ]
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Get color tokens from the 'Android' collection and from all groups named 'components'",
          "parsers": [
            {
              "name": "filter",
              "options": {
                "where": {
                  "collection": "^Android$",
                  "andWhere": {
                    "group": "^components$",
                    "andWhere": {
                      "token": ".*",
                      "withTypes": {
                        "include": ["color"]
                      },
                      "select": {
                        "token": true,
                        "parents": true
                      }
                    }
                  }
                }
              }
            }
          ]
        }
      ]
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Get tokens from the group named 'Components' and/or from the group named 'Semantic'",
          "parsers": [
            {
              "name": "filter",
              "options": {
                "where": {
                  "collection": "^Android$",
                  "andWhere": {
                    "group": "^Components$|^Semantic$",
                    "andWhere": {
                      "token": ".*",
                      "select": {
                        "token": true,
                        "parents": true
                      }
                    }
                  }
                }
              }
            }
          ]
        }
      ]
    }

    Select "Sync from Figma Variables & Tokens Studio" (Learn more ↗︎)

  • Click on "Create repository"

  • In the "Source" tab, click on "Create a source"

  • Select "Remote URL"

  • Paste your raw public URL of your JSON file

  • Select the format "Tokens Studio"

  • Let Specify check the connection

  • And voila!

  • Create and Paste this GitHub file URL such as: https://api.github.com/repos/{owner}/{repo}/contents/{file_path}

  • Select "Bearer Token" as the auth system & paste your personal access token from GitHub (Create an access token ↗︎ and be sure to check the repo section)

  • Select "Tokens Studio Format"

  • Specify will test your JSON

  • And voila!

  • Paste your Azure DevOps file URL such as https://dev.azure.com/{OrgName}/{ProjectName}/_apis/git/repositories/{RepositoryName}/items?path={FilePath}&api-version=7.0&includeContent=true

    Learn more in the Azure DevOps documentation

  • Select "Basic Auth" as auth system. Use your Azure DevOps email and a new Azure DevOps personal access token with Full Access or Code -> Read permissions.

  • Select "Tokens Studio Format"

  • Specify will test your JSON

  • And voila!

  • to your source
  • Paste your GitLab file URL such as: https://gitlab.com/api/v4/projects/{OrgName}%2F{RepositoryName}/repository/files/{FilePath}?ref={branch}

    Learn more on the GitLab documentation

  • Create an access token in GitLab: "Settings > Access Tokens". Select a role as Developer or Owner and select the scopes of read_api and read_repository.

  • In Specify, select Header as auth system

    1. Fill PRIVATE-TOKEN in the key field

    2. Paste your GitLab project access token

  • Select "Tokens Studio Format"

  • Specify will test your JSON

  • And voila!

  • Paste your BIN private URL such as https://api.jsonbin.io/v3/b/{bin_id}

  • Select Header as auth system

  • Depending on your choice, you can use your master key or an access key. Head toward this page on JSONBin.

    1. Following your choice, fill in the key field either with X-MASTER-KEY or X-ACCESS-KEY

    2. Paste your key in the value field

  • Select "Tokens Studio Format"

  • Specify will test your JSON

  • And voila!

  • 1. Sync your design tokens from Tokens Studio to a provider

    You can also manually export your file from Tokens Studio and upload it manually to your code repository. Click on Tools on the bottom left of the plugin and Export to file/folder. Be careful to tick all the boxes before exporting. We are not supporting multiple files at the moment.

    2. Add your JSON file from a provider to your Specify Repository

    From a public URL

    From a private URL

    GitHub

    Azure DevOps

    GitLab

    JSONBin

    3. How to update your JSON File

    4. Non-supported design token types

    GitHub
    GitLab
    Azure DevOps
    JSONBin
    GitHub
    Azure DevOps
    GitLab
    JSONBin
    feel free to send us feedback

    'names'

    Change the names or the modes of the selected items.

    toCase

    required

    The case transformation to apply. Actual transform is done by the package.

    applyTo

    required

    The selection where to apply the transformation. collection, group, token take a Regex string or true to select anything of the kind. An SDTFQuery can be used for advance use cases. Learn more about .

    This example helps you transform in kebabCase the name all collections, groups, tokens and modes. Use this example if you want to generate CSS Custom properties with the to-css-custom-properties parser.

    {
      "Colors": {
        "$collection": { "$modes": ["Light", "Dark"] },
        "Core": {
          "blue 100": {
            "$type": "color",
            "$description": "token 1 aliased with n modes within collection within n groups",
            "$value": {
              "Light": {
                "red": 255,
                "blue": 255,
                "alpha": 1,
                "green": 255,
                "model": "rgb"
              },
              "Dark": {
                "red": 229,
                "blue": 29,
                "alpha": 1,
                "green": 29,
                "model": "rgb"
              }
            }
          },
          "blue 700": {
            "$type": "color",
            "$description": "token 2 aliased with n modes within collection within n groups",
            "$value": {
              "Light": {
                "red": 255,
                "blue": 255,
                "alpha": 1,
                "green": 200,
                "model": "rgb"
              },
              "Dark": {
                "red": 229,
                "blue": 0,
                "alpha": 1,
                "green": 0,
                "model": "rgb"
              }
            }
          }
        },
        "semantic": {
          "background": {
            "button": {
              "primary": {
                "hover": {
                  "$type": "color",
                  "$description": "alias token with n modes within collection within n groups",
                  "$value": {
                    "Dark": {
                      "$mode": "dark",
                      "$alias": "Colors.Core.blue 100"
                    },
                    "Light": {
                      "$mode": "light",
                      "$alias": "Colors.Core.blue 700"
                    }
                  }
                }
              }
            }
          }
        }  
      }
    }

    We change the case of the token names and the modes to kebabCase. We applyTo the collection level so we transform in kebabCase:

    • the collection names

    • the group names

    • the token names

    • the mode names

    We eventually generate our transformed SDTF graph in a JSON file thanks to the parser.

    interface parser {
      name: 'change-case';
      options: {
        change?: 'name' | 'modes';
        toCase:
          | 'camelCase'
          | 'capitalCase'
          | 'constantCase'
          | 'kebabCase'
          | 'noCase'
          | 'pascalCase'
          | 'pascalSnakeCase'
          | 'pathCase'
          | 'sentenceCase'
          | 'snakeCase'
          | 'trainCase';
        applyTo:
          | { collection: string | true }
          | { group: string | true }
          | { token: string | true }
          | SDTFQuery;
      };
    }

    change

    Interface

    Options

    optional

    Basic usage

    to-json

    This parser helps you pull design tokens in JSON with token values in JSON or CSS.

    Interface

    interface parser {
      name: 'to-json';
      output: {
        type: 'file';
        filePath: string;
      };
      options?: {
        output?: 'raw' | 'css';
      };
    }

    Basic usage - JSON token values

    {
      "colors": {
    
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "To JSON",
          "parsers": [
            {
              "name": "to-json",
              "output": {
                "type": "file",
                "filePath": "tokens.json"
              }
            }
          ]
        }
      ]
    }
    tokens.json
    {
      "colors": {
        "Core": {
          "blue-100": {
            "dark": {
              "model": "rgb",
              "red": 229,
              "green": 29,
              "blue": 29,
              "alpha": 1
            },
            "light": {
              "model": "rgb",
              "red": 255,
              "green": 255,
              "blue": 255,
              "alpha": 1
            }
          },
          "blue-700": {
            "dark": {
              "model": "rgb",
              "red": 229,
              "green": 0,
              "blue": 0,
              "alpha": 1
            },
            "light": {
              "model": "rgb",
              "red": 255,
              "green": 200,
              "blue": 255,
              "alpha": 1
            }
          }
        },
        "semantic": {
          "background": {
            "button": {
              "primary": {
                "hover": {
                  "dark": {
                    "model": "rgb",
                    "red": 229,
                    "green": 29,
                    "blue": 29,
                    "alpha": 1
                  },
                  "light": {
                    "model": "rgb",
                    "red": 255,
                    "green": 200,
                    "blue": 255,
                    "alpha": 1
                  }
                }
              }
            }
          }
        }
      }
    }

    Advanced usage - CSS token values

    {
      "colors": {
        "$collection": {
          "$modes": [
            "light",
            "dark"
          ]
        },
        "Core": {
          "blue-100": {
            "$type": "color",
            "$value": {
              "dark": {
                "red": 229,
                "blue": 29,
                "alpha": 1,
                "green": 29,
                "model": "rgb"
              },
              "light": {
                "red": 255,
                "blue": 255,
                "alpha": 1,
                "green": 255,
                "model": "rgb"
              }
            },
            "$description": "token 1 aliased with n modes within collection within n groups"
          },
          "blue-700": {
            "$type": "color",
            "$value": {
              "dark": {
                "red": 229,
                "blue": 0,
                "alpha": 1,
                "green": 0,
                "model": "rgb"
              },
              "light": {
                "red": 255,
                "blue": 255,
                "alpha": 1,
                "green": 200,
                "model": "rgb"
              }
            },
            "$description": "token 2 aliased with n modes within collection within n groups"
          }
        },
        "semantic": {
          "background": {
            "button": {
              "primary": {
                "hover": {
                  "$type": "color",
                  "$value": {
                    "dark": {
                      "$mode": "dark",
                      "$alias": "colors.Core.blue-100"
                    },
                    "light": {
                      "$mode": "light",
                      "$alias": "colors.Core.blue-700"
                    }
                  },
                  "$description": "alias token with n modes within collection within n groups"
                }
              }
            }
          }
        }
      }
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "To JSON",
          "parsers": [
            {
              "name": "to-json",
              "output": {
                "type": "file",
                "filePath": "tokens.json"
              },
              "options": {
                "output": "css"
              }
            }
          ]
        }
      ]
    }
    tokens.json
    {
      "colors": {
        "Core": {
          "blue-100": {
            "dark": "rgb(229, 29, 29)",
            "light": "rgb(255, 255, 255)"
          },
          "blue-700": {
            "dark": "rgb(229, 0, 0)",
            "light": "rgb(255, 200, 255)"
          }
        },
        "semantic": {
          "background": {
            "button": {
              "primary": {
                "hover": {
                  "dark": "rgb(229, 29, 29)",
                  "light": "rgb(255, 200, 255)"
                }
              }
            }
          }
        }
      }
    }
    "$collection": {
    "$modes": [
    "light",
    "dark"
    ]
    },
    "Core": {
    "blue-100": {
    "$type": "color",
    "$value": {
    "dark": {
    "red": 229,
    "blue": 29,
    "alpha": 1,
    "green": 29,
    "model": "rgb"
    },
    "light": {
    "red": 255,
    "blue": 255,
    "alpha": 1,
    "green": 255,
    "model": "rgb"
    }
    },
    "$description": "token 1 aliased with n modes within collection within n groups"
    },
    "blue-700": {
    "$type": "color",
    "$value": {
    "dark": {
    "red": 229,
    "blue": 0,
    "alpha": 1,
    "green": 0,
    "model": "rgb"
    },
    "light": {
    "red": 255,
    "blue": 255,
    "alpha": 1,
    "green": 200,
    "model": "rgb"
    }
    },
    "$description": "token 2 aliased with n modes within collection within n groups"
    }
    },
    "semantic": {
    "background": {
    "button": {
    "primary": {
    "hover": {
    "$type": "color",
    "$value": {
    "dark": {
    "$mode": "dark",
    "$alias": "colors.Core.blue-100"
    },
    "light": {
    "$mode": "light",
    "$alias": "colors.Core.blue-700"
    }
    },
    "$description": "alias token with n modes within collection within n groups"
    }
    }
    }
    }
    }
    }
    }
    to-sdtf
    change-case
    how to query your SDTF graph
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Format all token names and modes to kebabCase and generate tokens in JSON",
          "parsers": [
            {
              "name": "change-case",
              "options": {
                "change": "names",
                "toCase": "kebabCase",
                "applyTo": {
                  "collection": true
                }
              }
            },
            {
              "name": "change-case",
              "options": {
                "change": "modes",
                "toCase": "kebabCase",
                "applyTo": {
                  "collection": true
                }
              }
            },
            {
              "name": "to-sdtf",
              "output": {
                "type": "file",
                "filePath": "tokens.json"
              }
            }
          ]
        }
      ]
    }
    tokens.json
    {
      "colors": {
        "$collection": { "$modes": ["light", "dark"] },
        "core": {
          "blue-100": {
            "$type": "color",
            "$description": "token 1 aliased with n modes within collection within n groups",
            "$value": {
              "light": {
                "red": 255,
                "blue": 255,
                "alpha": 1,
                "green": 255,
                "model": "rgb"
              },
              "dark": {
                "red": 229,
                "blue": 29,
                "alpha": 1,
                "green": 29,
                "model": "rgb"
              }
            }
          },
          "blue-700": {
            "$type": "color",
            "$description": "token 2 aliased with n modes within collection within n groups",
            "$value": {
              "light": {
                "red": 255,
                "blue": 255,
                "alpha": 1,
                "green": 200,
                "model": "rgb"
              },
              "dark": {
                "red": 229,
                "blue": 0,
                "alpha": 1,
                "green": 0,
                "model": "rgb"
              }
            }
          }
        },
        "semantic": {
          "background": {
            "button": {
              "primary": {
                "hover": {
                  "$type": "color",
                  "$description": "alias token with n modes within collection within n groups",
                  "$value": {
                    "dark": {
                      "$mode": "dark",
                      "$alias": "colors.core.blue-100"
                    },
                    "light": {
                      "$mode": "light",
                      "$alias": "colors.core.blue-700"
                    }
                  }
                }
              }
            }
          }
        }  
      }
    }
    'names' | 'modes'
    | 'camelCase'
    | 'capitalCase'
    | 'constantCase'
    | 'kebabCase'
    | 'noCase'
    | 'pascalCase'
    | 'pascalSnakeCase'
    | 'pathCase'
    | 'sentenceCase'
    | 'snakeCase'
    | 'trainCase'
    | { collection: string | true }
    | { group: string | true }
    | { token: string | true }
    | SDTFQuery
    Learn more in the GitHub documentation

    to-tailwind

    This parser helps you generate a Tailwind theme from all your design tokens coming from Specify.

    Learn more about Specify

    Interface

    Basic usage

    Advanced usage - token values as CSS variables

    {
      "colors": {
        "$collection": {
          "$modes": [
            "light",
            "dark"
          ]
        },
        "aliases": {
          "border": {
            "active": {
              "$type": "color",
              "$value": {
                "dark": {
                  "$alias": "colors.core.label.blue-base",
                  "$mode": "dark"
                },
                "light": {
                  "$alias": "colors.core.label.blue-base",
                  "$mode": "light"
                }
              }
            }
          }
        },
        "core": {
          "label": {
            "blue-base": {
              "$type": "color",
              "$value": {
                "dark": {
                  "model": "rgb",
                  "red": 96,
                  "green": 168,
                  "blue": 250,
                  "alpha": 1
                },
                "light": {
                  "model": "rgb",
                  "red": 17,
                  "green": 125,
                  "blue": 249,
                  "alpha": 1
                }
              }
            },
            "blue-lighter": {
              "$type": "color",
              "$value": {
                "dark": {
                  "model": "rgb",
                  "red": 41,
                  "green": 52,
                  "blue": 67,
                  "alpha": 1
                },
                "light": {
                  "model": "rgb",
                  "red": 219,
                  "green": 236,
                  "blue": 254,
                  "alpha": 1
                }
              }
            }
          }
        }
      },
      "dimensions": {
        "$collection": {
          "$modes": [
            "desktop",
            "mobile"
          ]
        },
        "base": {
          "dimension-01": {
            "$type": "dimension",
            "$value": {
              "mobile": {
                "value": 2,
                "unit": "px"
              },
              "desktop": {
                "value": 4,
                "unit": "px"
              }
            }
          },
          "dimension-02": {
            "$type": "dimension",
            "$value": {
              "mobile": {
                "value": 4,
                "unit": "px"
              },
              "desktop": {
                "value": 8,
                "unit": "px"
              }
            }
          }
        }
      }
    }
    interface parser {
      name: 'to-tailwind';
      output: {
        type: 'file';
        filePath: string; // e.g theme.js
      };
      options?: {
        useCssVariable?: boolean;
        cssVariableTemplate?: {
          tokenNameTemplate?: string;
          tokenNotInCollectionNameTemplate?: string;
        }
      };
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Generate tokens as a Tailwind theme",
          "parsers": [
            {
              "name": "to-tailwind",
              "output": {
                "type": "file",
                "filePath": "theme.js"
              }
            }
          ]
        }
      ]
    }
    theme.js
    /** @type {import('tailwindcss').Config} */
    module.exports = {
      theme: {
        extend: {
          colors: {
            colors: {
              core: {
                label: {
                  'blue-lighter': {
                    'dark': 'rgb(41, 52, 67)',
                    'light': 'rgb(219, 236, 254)'
                  },
                  'blue-base': {
                    'dark': 'rgb(96, 168, 250)',
                    'light': 'rgb(17, 125, 249)'
                  }
                }
              },
              aliases: {
                border: {
                  active: {
                    'dark': 'rgb(98, 77, 227)',
                    'light': 'rgb(235, 33, 33)'
                  }
                }
              }
            }
          },
          spacing: {
            'dimensions-base-dimension-01-desktop': '4px',
            'dimensions-base-dimension-01-mobile': '2px',
            'dimensions-base-dimension-02-desktop': '8px',
            'dimensions-base-dimension-02-mobile': '4px'
          }
        }
      }
    }
    {
      "colors": {
        "$collection": {
          "$modes": [
            "light",
            "dark"
          ]
        },
        "aliases": {
          "border": {
            "active": {
              "$type": "color",
              "$value": {
                "dark": {
                  "$alias": "colors.core.label.blue-base",
                  "$mode": "dark"
                },
                "light": {
                  "$alias": "colors.core.label.blue-base",
                  "$mode": "light"
                }
              }
            }
          }
        },
        "core": {
          "label": {
            "blue-base": {
              "$type": "color",
              "$value": {
                "dark": {
                  "model": "rgb",
                  "red": 96,
                  "green": 168,
                  "blue": 250,
                  "alpha": 1
                },
                "light": {
                  "model": "rgb",
                  "red": 17,
                  "green": 125,
                  "blue": 249,
                  "alpha": 1
                }
              }
            },
            "blue-lighter": {
              "$type": "color",
              "$value": {
                "dark": {
                  "model": "rgb",
                  "red": 41,
                  "green": 52,
                  "blue": 67,
                  "alpha": 1
                },
                "light": {
                  "model": "rgb",
                  "red": 219,
                  "green": 236,
                  "blue": 254,
                  "alpha": 1
                }
              }
            }
          }
        }
      },
      "dimensions": {
        "$collection": {
          "$modes": [
            "desktop",
            "mobile"
          ]
        },
        "base": {
          "dimension-01": {
            "$type": "dimension",
            "$value": {
              "mobile": {
                "value": 2,
                "unit": "px"
              },
              "desktop": {
                "value": 4,
                "unit": "px"
              }
            }
          },
          "dimension-02": {
            "$type": "dimension",
            "$value": {
              "mobile": {
                "value": 4,
                "unit": "px"
              },
              "desktop": {
                "value": 8,
                "unit": "px"
              }
            }
          }
        }
      }
    }
    .specifyrc.json
    {
      "version": "2",
      "repository": "@organization/repository",
      // Only use the personalAccessToken when working with the CLI
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Generate tokens as a Tailwind theme",
          "parsers": [
            {
              "name": "to-tailwind",
              "output": {
                "type": "file",
                "filePath": "theme.js"
              },
              "options": {
                "useCssVariable": true,
                "cssVariableTemplate": {
                  "tokenNameTemplate": "--{{groups}}-{{token}}"
                }
              }
            }
          ]
        }
      ]
    }
    theme.js
    /** @type {import('tailwindcss').Config} */
    module.exports = {
      theme: {
        extend: {
          colors: {
            colors: {
              core: {
                label: {
                  'blue-base': {
                    dark: 'var(--core-label-blue-base)',
                    light: 'var(--core-label-blue-base)'
                  },
                  'blue-lighter': {
                    dark: 'var(--core-label-blue-lighter)',
                    light: 'var(--core-label-blue-lighter)'
                  }
                }
              },
              aliases: {
                border: {
                  active: {
                    dark: 'var(--aliases-border-active)',
                    light: 'var(--aliases-border-active)'
                  }
                }
              }
            }
          },
          spacing: {
            'dimensions-base-dimension-01-desktop': 'var(--base-dimension-01)',
            'dimensions-base-dimension-01-mobile': 'var(--base-dimension-01)',
            'dimensions-base-dimension-02-desktop': 'var(--base-dimension-02)',
            'dimensions-base-dimension-02-mobile': 'var(--base-dimension-02)'
          }
        }
      }
    }

    Parsers

    Parsers are functions allowing you to transform design tokens and assets coming from Specify to fit your needs and company standards.

    By default, without any parsers, Specify will return your design data as raw data:

    • Design tokens are returned in JSON

    • Assets are returned as files

    There are high chances you need to transform those design data to fit your needs. Parsers help you do just that.

    How to sync Figma Variables and Styles to Specify (3min)
    Parsers are functions allowing you to transform design tokens and assets coming from Specify to fit your needs and company standards.
    An example output pipeline that pulls colors from Specify, sorts them alphabetically and transforms them as CSS Custom Properties

    A parser does the following job:

    1. Receives design data as input

    2. Transforms this design data

    3. Returns the transformed data

    The data returned by a parser can either be:

    • Design data that can be used by another parser coming next in your transformation pipeline

    • A file so it can be used by people, frameworks, or scripts

    Parsers are ordered and takes specific input to generate specific output. This way, we can easily test the input coming from the previous parser to check if the whole parsers process will work.

    Parsers are classified in 2 categories: technology and utility.

    Technology parsers help you transform your design tokens to specific technologies and formats (CSS Custom properties, SCSS, Tailwind, a Javascript theme object compatible with React Native...)

    Some examples:

    • to-react-native

    • to-css-custom-properties

    • to-scss-variables

    • to-tailwind

    Utility parsers take care of "smaller" transformation. Like converting a pixel value to rem or transforming a string to kebabcase.

    Some examples:

    • convert-font

    • kebabcasify

    • px-to-rem

    All parsers are open source and available on the following GitHub repository.

    Parser
    Description
    Usage Example

    Why you need parsers

    What are parsers?

    Parsers help you transform raw design tokens and assets returned by Specify to match your company standards

    Parsers are what make Specify powerful and flexible. They help you be in total control of the design data you pull from Specify.

    Categories

    Technology

    Utility

    All parsers available

    Configuration

    Learn more about how to configure Specify to generate design tokens and assets fitting your company standards.

    Introduction

    By default, without any parsers, Specify returns your design data as raw data:

    • Design tokens are returned in JSON

    • Assets are returned as files

    A configuration file helps you:

    1. request design tokens and assets from a Specify repository

    2. transform them to fit your company standards thanks to rules, token types and parsers.

    A configuration is composed of 3 main properties:

    • repository

    • personalAccessToken

    • rules

    The name of the Specify repository you want to pull your design tokens and assets from.

    Let's say we have the following repository in Specify called "all-design-data" located in the "@acme-inc" organization.

    We target it like this:

    The Specify personalAccessToken used to authenticate your actions.

    Rules help you transform your design tokens and assets the way you want.

    You can have as many rules as you want and you can have rules that transform several at once.

    A rule is composed of the following properties:

    Name
    Type
    Required
    Description

    Parsers are functions allowing you to transform design tokens and assets coming from Specify to fit your needs and company standards.

    Inside a configuration, a parser has the following properties:

    Name
    Type
    Required
    Description

    Here's a rule named "Design Tokens" that:

    1. targets color and measurement design tokens

    2. sorts them alphabetically by their name

    3. transforms them as CSS Custom Properties

    The following examples are made to be used with the Specify CLI.

    Requirements:

    • a Specify repository containing design tokens

    • a valid personal access token ()

    Run all examples by copying the code and running the specify pull command.

    Here's a basic configuration file that targets a Specify repository called all-design-data from the @acme-inc organization:

    This example config file will return a design-tokens.json file containing all design tokens and assets stored in the all-design-data repository.

    Here's an example of a token value returned by Specify:

    Now let's update our previous configuration to only pull colors and transform them as CSS Custom Properties in HSL.

    Here is the input returned by Specify and the output generated by Specify after executing our configuration.

    writes them in a design-tokens.css file inside a styles folder

    .specifyrc.js
    module.exports = {
      repository: '@acme-inc/all-design-data',
      personalAccessToken: '<your-personal-access-token>',
      rules: [],
    };
    .specifyrc.json
    {
      "repository": "@acme-inc/all-design-data",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": []
    }
    module.exports = {
      repository: '@workspace/repository',
      personalAccessToken: '<your-personal-access-token>',
      rules: [],
    };
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": []
    }
    interface Rule {
      name: string;
      path: string;
      filter?: {
        types: Array<TokenType>
      };
      parsers?: Array<Parser>;
    };

    name

    string

    true

    The name of your rule.

    interface Parser {
      name: string;
      options?: Record<string, any>;
    }

    name

    string

    true

    The name of the parser. Choose from .

    .specifyrc.js
    [
      {
        name: 'Design Tokens',
        path: 'styles/design-tokens.css',
        filter: {
          types: ['color', 'measurement']
        },
        parsers: [
          {
            name: 'sort-by',
            options: {
              keys: ['name']
            }
          },
          {
            name: 'to-css-custom-properties'
          }
        ]
      },
    ]
    .specifyrc.json
    [
      {
        "name": "Design Tokens",
        "path": "styles/design-tokens.css",
        "filter": {
          "types": ["color", "measurement"]
        },
        "parsers": [
          {
            "name": "sort-by",
            "options": {
              "keys": ["name"]
            }
          },
          {
            "name": "to-css-custom-properties"
          }
        ]
      }
    ]
    .specifyrc.json
    {
      "repository": "@acme-inc/all-design-data",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "All design tokens in JSON",
          "path": "design-tokens.json",
          "parsers": []
        }
      ]
    }
    .specifyrc.js
    module.exports = {
      repository: '@acme-inc/all-design-data',
      personalAccessToken: '<your-personal-access-token>',
      rules: [
        {
          name: 'All design tokens in JSON',
          path: 'design-tokens.json',
          parsers: [],
        },    
      ],
    };
    {
      "id": String,
      "createdAt": String,
      "updatedAt": String,
      "name": String,
      "value": Object,
      "meta": Object,
      "type": String,
      "originId": String,
      "sourceId": String,
      "description": String,
      "repositoryId": String
    }
    .specifyrc.js
    module.exports = {
      repository: '@acme-inc/all-design-data',
      personalAccessToken: '<your-personal-access-token>',
      rules: [
        {
          name: 'All design tokens in JSON',
          path: 'colors.css',
          filter: {
            types: ['color']
          },
          parsers: [
            {
              name: 'to-css-custom-properties',
              options: {
                formatTokens: {
                  color: 'hsl'
                },
              },
            },
          ],
        },
      ],
    };
    .specifyrc.json
    {
      "repository": "@acme-inc/all-design-data",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Colors as CSS Custom Properties",
          "path": "colors.css",
          "filter": {
            "types": ["color"]
          },
          "parsers": [
            {
              "name": "to-css-custom-properties",
              "options": {
                "formatTokens": {
                  "color": "hsl"
                }
              }
            }
          ]
        }
      ]
    }
    [
      {
        "name": "Primary/100",
        "value": {
          "a": 1,
          "b": 254,
          "g": 233,
          "r": 237
        },
        "type": "color",
        "description": ""
      },
      {
        "name": "Primary/200",
        "value": {
          "a": 1,
          "b": 254,
          "g": 214,
          "r": 221
        },
        "type": "color",
        "description": ""
      },
      {
        "name": "Primary/300",
        "value": {
          "a": 1,
          "b": 253,
          "g": 181,
          "r": 196
        },
        "type": "color",
        "description": ""
      }
    ]
    colors.css
    :root {
      /* COLOR */
      --primary-100: hsl(251, 91%, 95%);
      --primary-200: hsl(251, 95%, 92%);
      --primary-300: hsl(252, 95%, 85%);
    }

    Properties

    Repository

    You can only target one repository per configuration file. Want to pull design tokens from several Specify repositories? Create a several configuration files and run them with the Specify CLI.

    Personal Access Token

    Need a personal access token?

    Rules

    Parsers

    Example

    Examples

    How to run these examples

    Basic

    Pull colors as CSS Custom Properties

    Token types
    Generate one ↗
    An example Specify repository called "all-design-data" located in the "@acme-inc" organization.

    Apply camelcase function on specific keys from a design token.

    Convert font in several formats.

    Filter tokens and assets by their name using a regular expression.

    Replace all the stroke and fill attribute raw color value by its corresponding design token as a CSS variable. If no design token match, the raw value will be left as is.

    Apply kebabcase function on specific keys from a design token.

    Have design tokens referencing other ones.

    Set a structured filename on your assets. It won't rename your asset but only add a new filename property on the asset object. The filename structure uses as a template engine.

    Omit keys from a design token not given in parameters.

    Apply pascalcase function on specific keys from a design token.

    Get only specific keys from a design token given in params.

    Concatenate two strings.

    Convert the value of a measurement design token from pixel to rem.

    Replace any string matched by a regex by a new string.

    Round any measurement design token with specific precision.

    Apply snakecase function on specific keys from a design token.

    Loop on several design tokens and sort them according to their respective key values.

    Concatenate two strings.

    Wrap SVG files within a JSX component.

    Optimize vectors using .

    Transform design tokens in CSS Custom Properties.

    Create CSS @font-face rules to import your font files.

    Create text styles as CSS classes.

    Create a .

    Format design tokens to create a theme compatible with the .

    Transform design tokens in JSS.

    Transform design tokens to a JavaScript theme object compatible with .

    Generate .scss files containing Scss map and function / mixin to access the values of the tokens.

    Create text styles formatted as .

    Transform design tokens in SCSS variables.

    Generate configuration files for all your design tokens coming from Specify.

    Format design tokens to create a theme compatible with the .

    Format design tokens to create a theme compatible with the .

    Format design tokens to create their corresponding TypeScript types.

    camelcasify
    Example
    convert-font
    Example
    filter
    Example
    inline-css-variables-in-svg
    Example
    kebabcasify
    Example
    link-design-tokens
    Example
    name-assets-files-by-pattern
    mustache
    Example
    omit
    Example
    pascalcasify
    Example
    pick
    Example
    prefix-by
    Example
    px-to-rem
    Example
    replace-string
    Example
    round-number
    Example
    snakecasify
    Example
    sort-by
    Example
    suffix-by
    Example
    svg-to-jsx
    Example
    svgo
    svgo
    Example
    to-css-custom-properties
    Example
    to-css-font-import
    Example
    to-css-text-style
    Example
    to-dsp
    Design System Package (DSP)
    Example
    to-flutter
    Flutter specification
    Example
    to-jss
    Example
    to-react-native
    React Native
    Example
    to-scss-map
    Example
    to-scss-mixin-text-style
    SCSS mixins
    Example
    to-scss-variables
    Example
    to-style-dictionary
    Style Dictionary
    Example
    to-tailwind
    TailwindCSS specification
    Example
    to-theme-ui
    theme-ui specification
    Example
    to-typescript-definition
    Example

    path

    string

    true

    The path in your project where you want Specify to generate your design data.

    If you want to pull bitmap, vector or font token types you must set a directory (Learn more ↗).

    filter

    Record<'types', Array<TokenType>>

    false

    The list of Token type you want your rule to target.

    parsers

    Array<Parser>

    false

    The parsers you want to apply to transform your Token types. For further details see Parsers.

    options

    Record<string, any>

    false

    The options relative to the parser you apply. Each parser has its own options you can find in their respective README file.

    all available parsers
    Generate one ↗
    An example Specify repository called 'all-design-data' located in the '@acme-inc' organization.

    Token types

    Types define every type of design token and asset Specify is compatible with. Use them to target specific types of design data you want to pull from Specify and manage with rules and parsers.

    Introduction

    Types define every type of design token and asset Specify is compatible with. Use them to target specific types of design tokens and assets you want to pull from Specify.

    In Specify, types are displayed as "categories" of design data you can create and find in your Specify repository.

    Specify is compatible with the following design tokens and assets under the TokenType type.

    Design tokens

    Border

    A border is a line surrounding a UI element. According to your target platform capabilities, you can define the border to go inside (inner border), outside (outer border), or between them (center).

    Borders are considered as composite design tokens ↗ because they are composed of several design tokens.

    Looking for border radius? You can add them as a type.

    interface BorderValue {
      color: {
        value: ColorValue;
      };
      type:
        | 'none'
        | 'hidden'
        | 'dotted'
        | 'dashed'
        | 'solid'
        | 'double'
        | 'groove'
        | 'ridge'
        | 'inset'
        | 'outset';
      width: {
        value: MeasurementValue;
      };
      align?: string;
      radii?: MeasurementValue;
      rectangleCornerRadii?: Array<MeasurementValue>;
      dashes?: Array<MeasurementValue>;
    }

    Color

    Colors have meaning and support the purpose of the content, communicating things like hierarchy of information, interactive states, and the difference between distinct elements in your UI. Among all your design token types, color is surely one of the most important ones.

    The Depth token type sets a UI element's position on the z-axis. More commonly called z-index on and zIndex on and .

    Represents the length of time in milliseconds an animation or animation cycle takes to complete, such as 200 milliseconds (cf ).

    A gradient is the gradual blending from one color to another. It enables the designer to almost create a new color. It makes objects stand out by adding a new dimension to the design and adding realism to the object. In simple terms, gradients add depth.

    Gradients are considered as because they are composed of several design tokens.

    Measurement or design tokens help you define size values.

    Common design tokens can be defined from this type:

    • internal margins

    • external margins

    • a spacing scale

    • a border width

    Opacity design tokens help you set the opacity of UI elements.

    Shadows help you communicate components elevation in your UIs. Popular variations and names include box-shadow, drop shadow, and many more.

    Shadows are considered as because they are composed of several design tokens.

    Text styles or typography helps your UI be usable. They create balance, hierarchy and structure for your content. Some say that "Web is 95% typography". To push this even further let's say UI are 95% typography. In other words, pay a great deal of attention to typography.

    A text style is composed of several child design decisions that could be considered as single design tokens like:

    • a line-height

    • a font size

    • a letter spacing

    • a font name

    Text styles are considered as because they are composed of several design tokens.

    Bitmaps are raster images you can use in many contexts. They are basically any image you can display in a UI that is a .png, .jpeg, .webp, .avif...

    Fonts are files containing typefaces used by your text styles.

    In Specify, all font files are stored as .ttf files by default. You can pull and convert them on the fly thanks to the parser.

    By "vectors" we mean vector images (e.g., SVG and PDF files). You can use them for 2 main purposes: iconography and illustration. In the following section we will only focus on icons.

    Icons act a visual aids to help users complete tasks. We advise you to have an harmonic set of icons you can use to draw attention to specific actions.

    a breakpoint

  • a font size

  • border radii...

  • Depth

    Duration

    Gradient

    Measurement

    Opacity

    Shadow

    Text Style

    Example

    Assets

    Bitmap

    Font

    Vector

    Example

    Web ↗
    Android ↗
    iOS ↗
    DTCG ↗
    composite design tokens ↗
    Dimension ↗
    composite design tokens ↗
    composite design tokens ↗
    convert-font ↗
    Measurement
    interface ColorValue {
      r: number;
      g: number;
      b: number;
      a: number;
    }
    interface DepthValue {
      depth: number;
    }
    interface DurationValue {
      duration: number;
      unit: string;
    }
    interface StepForGradient {
      type: string;
      color: {
        value: ColorValue;
      };
      position: number;
    }
    
    interface Gradient {
      angle: string;
      colors: Array<StepForGradient>;
    }
    
    interface GradientValue {
      gradients: Array<Gradient>;
    }
    interface MeasurementValue {
      measure: number;
      unit?: string;
    }
    interface OpacityValue {
      opacity: number;
    }
    type ShadowValue = Array<{
      color: {
        value: ColorValue;
      };
      offsetX: {
        value: MeasurementValue;
      };
      offsetY: {
        value: MeasurementValue;
      };
      blur: {
        value: MeasurementValue;
      };
      spread?: {
        value: MeasurementValue;
      };
      isInner: boolean;
    }>;
    export type TextTransformValue =
      | 'none'
      | 'capitalize'
      | 'uppercase'
      | 'lowercase';
    
    export type TextDecorationValue =
      | 'none'
      | 'underline'
      | 'overline'
      | 'line-through'
      | 'dashed'
      | 'wavy';
    
    export type HorizontalAlignValue =
      | 'initial'
      | 'left'
      | 'right'
      | 'center'
      | 'justify'
      | 'start'
      | 'end'
      | 'justify-all'
      | 'match-parent';
    
    export type VerticalAlignValue =
      | 'initial'
      | 'baseline'
      | 'sub'
      | 'super'
      | 'text-top'
      | 'text-bottom'
      | 'middle'
      | 'top'
      | 'bottom';
      
    export interface TextStyleValue {
      color?: {
        value: ColorValue;
      };
      font: {
        value: FontValue;
      };
      fontSize: {
        value: MeasurementValue;
      };
      lineHeight?: {
        value: MeasurementValue;
      };
      letterSpacing?: {
        value: MeasurementValue;
      };
      textAlign?: {
        horizontal?: HorizontalAlignValue;
        vertical?: VerticalAlignValue;
      };
      textTransform?: TextTransformValue;
      fontVariant?: Array<string>;
      textDecoration?: Array<TextDecorationValue>;
      textIndent?: {
        value: MeasurementValue;
      };
    }
    .specifyrc.js
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Design Tokens / Borders",
          "path": "borders.json",
          "filter": {
            "types": [
              "border"
            ]
          }
        }
      ]
    }
    .specifyrc.js
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Design Tokens / Colors",
          "path": "colors.json",
          "filter": {
            "types": [
              "color"
            ]
          }
        }
      ]
    }
    .specifyrc.js
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Design Tokens / zIndex",
          "path": "zIndex.json",
          "filter": {
            "types": [
              "depth"
            ]
          }
        }
      ]
    }
    .specifyrc.js
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Design Tokens / durations",
          "path": "durations.json",
          "filter": {
            "types": [
              "duration"
            ]
          }
        }
      ]
    }
    .specifyrc.js
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Design Tokens / Gradients",
          "path": "gradients.json",
          "filter": {
            "types": [
              "gradient"
            ]
          }
        }
      ]
    }
    .specifyrc.js
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Design Tokens / Measurements",
          "path": "measurements.json",
          "filter": {
            "types": [
              "measurement"
            ]
          }
        }
      ]
    }
    .specifyrc.js
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Design Tokens / Opacities",
          "path": "opacities.json",
          "filter": {
            "types": [
              "opacity"
            ]
          }
        }
      ]
    }
    .specifyrc.js
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Design Tokens / Shadows",
          "path": "shadows.json",
          "filter": {
            "types": [
              "shadow"
            ]
          }
        }
      ]
    }
    .specifyrc.js
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Design Tokens / Text Styles",
          "path": "textStyles.json",
          "filter": {
            "types": [
              "textStyle"
            ]
          }
        }
      ]
    }
    interface BitmapValue {
      url: string;
      dimension?: number;
      format?: string;
    }
    export type Provider = 'Custom font' | 'Google Fonts';
    
    export type FontWeightKeys = '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
    
    export interface FontValue {
      fontFamily: string;
      fontPostScriptName: string;
      fontWeight?: string | number;
      fontFileMissing?: boolean;
      isItalic?: boolean;
      provider?: Provider;
      url?: string;
      format?: 'ttf';
    }
    interface VectorValue {
      url: string;
      format: 'svg' | 'pdf';
    }
    .specifyrc.js
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Design Tokens / Images",
          "path": "bitmaps.json",
          "filter": {
            "types": [
              "bitmap"
            ]
          }
        }
      ]
    }
    .specifyrc.js
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Design Tokens / Fonts",
          "path": "fonts.json",
          "filter": {
            "types": [
              "font"
            ]
          }
        }
      ]
    }
    .specifyrc.js
    {
      "repository": "@workspace/repository",
      "personalAccessToken": "<your-personal-access-token>",
      "rules": [
        {
          "name": "Design Tokens / Icons",
          "path": "vectors.json",
          "filter": {
            "types": [
              "vector"
            ]
          }
        }
      ]
    }
    Video tutorial (7min) to help you sync tokens from Tokens Studio to your local git repo as CSS variables