Theemo / @theemo/style-dictionary / isNoComputedToken
Function: isNoComputedToken()
ts
function isNoComputedToken(token): boolean;
Defined in: filters/computed.ts:97
Checks whether a token contains NO transforms.
A computed token:
json
{
"$value": {
"value": "#ee00aa",
"transforms": {
"alpha": -10
}
},
"$type": "color"
}
Parameters
Parameter | Type | Description |
---|---|---|
token | TransformedToken | the token in question |
Returns
boolean
true
when the token contains NO transform, otherwise false
Example
Usage:
js
import StyleDictionary from 'style-dictionary';
import { isNoComputedToken } from '@theemo/style-dictionary';
export default {
source: ['tokens/**/*.json'],
platforms: {
css: {
files: [
{
format: 'css/variables',
destination: 'raw-tokens.css',
filter: isNoComputedToken
}
]
}
}
};