Skip to content

Theemo / @theemo/style-dictionary / isReferenceToken

Function: isReferenceToken()

ts
function isReferenceToken(token): boolean;

Defined in: filters/reference.ts:35

Check whether a token references another token.

Parameters

ParameterTypeDescription
tokenTransformedTokenthe token in question

Returns

boolean

true when the token references another one, otherwise false

Example

Usage:

js
import StyleDictionary from 'style-dictionary';
import { isReferenceToken } from '@theemo/style-dictionary';

export default {
  source: ['tokens/**/*.json'],
  platforms: {
    css: {
      files: [
        {
          format: 'css/variables',
          destination: 'references.css',
          filter: isReferenceToken
        }
      ]
    }
  }
};