Builder

Variables

camelCaseTransform

const camelCaseTransform: Transform;

CSS_EXTENSION

const CSS_EXTENSION: "com.tokun.css" = "com.tokun.css";

cssBorderStyleTransform

const cssBorderStyleTransform: Transform;

cssFontTransform

const cssFontTransform: Transform;

cssFormat

const cssFormat: Format;

CSS formatter. Custom extension com.tokun.css with value and resolvedValue properties is used to take transformed values (recommended for better CSS output). Otherwise, the value and resolvedValue will be used.

Reference:


cssGradientTransform

const cssGradientTransform: Transform;

cssShadowTransform

const cssShadowTransform: Transform;

cssTransforms

const cssTransforms: TransformGroup;

cssUnitTransform

const cssUnitTransform: Transform;

cssVariableSafeTransform

const cssVariableSafeTransform: Transform;

detailedJsonFormat

const detailedJsonFormat: Format;

Detailed JSON formatter.


dtcgJsonLoader

const dtcgJsonLoader: Loader;

flattenJsonFormat

const flattenJsonFormat: Format;

Simple JSON formatter.


kebabCaseTransform

const kebabCaseTransform: Transform;

pascalCaseTransform

const pascalCaseTransform: Transform;

RESOLVED_EXTENSION

const RESOLVED_EXTENSION: "com.tokun.resolvedValue" = "com.tokun.resolvedValue";

snakeCaseTransform

const snakeCaseTransform: Transform;

Functions

build()

function build(config): BuildOutput[];

Build design tokens.

Parameters

ParameterTypeDescription
configConfigConfiguration object.

Returns

BuildOutput[]

Array of objects with name and content properties.


camel()

function camel(str): string;

Formats the given string in camel case fashion

camel('hello world') -> 'helloWorld' camel('va va-VOOM') -> 'vaVaVoom' camel('helloWorld') -> 'helloWorld'

Parameters

ParameterType
strstring

Returns

string


dash()

function dash(str): string;

Formats the given string in dash case fashion

dash('hello world') -> 'hello-world' dash('va va_VOOM') -> 'va-va-voom' dash('helloWord') -> 'hello-word'

Parameters

ParameterType
strstring

Returns

string


pascal()

function pascal(str): string;

Formats the given string in pascal case fashion

pascal('hello world') -> 'HelloWorld' pascal('va va boom') -> 'VaVaBoom'

Parameters

ParameterType
strstring

Returns

string


resolveTokens()

function resolveTokens(tokens): FlattenTokens;

Resolves all token references in the given token collection

Parameters

ParameterType
tokensFlattenTokens

Returns

FlattenTokens


snake()

function snake(str, options?): string;

Formats the given string in snake case fashion

snake('hello world') -> 'hello_world' snake('va va-VOOM') -> 'va_va_voom' snake('helloWord') -> 'hello_world'

Parameters

ParameterType
strstring
options?{ splitOnNumber?: boolean; }
options.splitOnNumber?boolean

Returns

string