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:
- https://www.w3.org/TR/CSS22/syndata.html#value-def-identifier
- https://drafts.csswg.org/css-variables/#defining-variables
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
Parameter | Type | Description |
---|---|---|
config | Config | Configuration 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
Parameter | Type |
---|---|
str | string |
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
Parameter | Type |
---|---|
str | string |
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
Parameter | Type |
---|---|
str | string |
Returns
string
resolveTokens()
function resolveTokens(tokens): FlattenTokens;
Resolves all token references in the given token collection
Parameters
Parameter | Type |
---|---|
tokens | FlattenTokens |
Returns
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
Parameter | Type |
---|---|
str | string |
options? | { splitOnNumber? : boolean ; } |
options.splitOnNumber? | boolean |
Returns
string