I am using Amazon Style Dictionary to generate SCSS variables from JS definition files. Given the following input:
module.exports = {
color: {
border: {
focus: { value: '#0071ff' }
}
}
}
I would like to generate not one output variable for this, but two (HEX and RGB). Is it possible to write a custom value transformer that spits out multiple values for a given input? Or do I need to run a separate pipeline for this use case?
This could be your
colors.jsonfile configurationto provide to your StyleDictionary configuration.
So you grab the sources from your
sources/colors.jsfile and create in output in thedistfolder two subfolders,rgbcontainingcolors-rgb.cssandhexcontainingcolors-hex.css.