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.json
file configurationto provide to your StyleDictionary configuration.
So you grab the sources from your
sources/colors.js
file and create in output in thedist
folder two subfolders,rgb
containingcolors-rgb.css
andhex
containingcolors-hex.css
.