Amazon style dictionary configured with Cloudflight best practices in mind.
The following dependencies are required:
"style-dictionary": "*"
Create a javascript file with the following content:
import {cloudflightPlatformConfigWith, registerItems} from '@cloudflight/style-dictionary-transformer';
import StyleDictionary from 'style-dictionary';
registerItems(StyleDictionary);
const StyleDictionaryExtended = StyleDictionary.extend({
source: ['assets/design-tokens/*.json'],
platforms: {
...cloudflightPlatformConfigWith({
web: {
declaration: {
outputDirectory: '<your-output-directory>',
},
},
}),
},
});
StyleDictionaryExtended.buildAllPlatforms();
Execute this script as part of your build. It will generate styles into you output directory for further use.