Theemo / @theemo/style-dictionary / StyleDictionaryWriterConfig
Interface: StyleDictionaryWriterConfig
Defined in: packages/style-dictionary/src/config.ts:11
The config for Style Dicitionary being used as WriterTool
.
Remarks
The result from Lexer
is pushed into the writer. Such, the configuration requires you to provide the file for the respective token and the "path" (the canonical name of the token, so to say) within that file.
Properties
dataForToken()?
optional dataForToken: (token) => Record<string, unknown>;
Defined in: packages/style-dictionary/src/config.ts:50
Customize the data for a token
Parameters
Parameter | Type | Description |
---|---|---|
token | Token | the Token |
Returns
Record
<string
, unknown
>
additional properties for a token
directory?
optional directory: string;
Defined in: packages/style-dictionary/src/config.ts:17
The directory to which the tokens are written to
Default Value
tokens
fileForToken()
fileForToken: (token) => string;
Defined in: packages/style-dictionary/src/config.ts:25
The file for the given token.
Parameters
Parameter | Type | Description |
---|---|---|
token | Token | the Token |
Returns
string
the file path
pathForToken()
pathForToken: (token) => string[];
Defined in: packages/style-dictionary/src/config.ts:33
The path (the canonical name) of the token
Parameters
Parameter | Type | Description |
---|---|---|
token | Token | the Token |
Returns
string
[]
the segments of the name
valueForToken()?
optional valueForToken: (token, tokens) => undefined | string;
Defined in: packages/style-dictionary/src/config.ts:42
The value for the given token
Parameters
Parameter | Type | Description |
---|---|---|
token | Token | the Token |
tokens | TokenCollection | all tokens |
Returns
undefined
| string
the value for the given token