Theemo / @theemo/style-dictionary / isCSSProperty
Function: isCSSProperty()
ts
function isCSSProperty(token): boolean;Defined in: filters/css-property.ts:46
Checks whether a token can be formatted into a CSS @property. Use it in combination with the css/properties formatter.
Parameters
| Parameter | Type | Description |
|---|---|---|
token | TransformedToken | the token in question |
Returns
boolean
true when the token can be formatted as @property, otherwise false
Example
Usage:
js
import StyleDictionary from 'style-dictionary';
import { isCSSProperty, cssPropertiesFormater } from '@theemo/style-dictionary';
StyleDictionary.registerFormat(cssPropertiesFormater);
export default {
source: ['tokens/**/*.json'],
platforms: {
css: {
files: [
{
format: 'css/properties',
destination: 'properties.css',
filter: isCSSProperty
}
]
}
}
};