Open caoimghgin opened 2 years ago
You could use a custom parser to modify tokens before Style Dictionary tries to transform and resolve tokens. The custom parser would parse the JSON files and search for tokens with references to a list of known references you want to change and then update the token's value. Does that make sense?
Using the 'outputReferences' feature in SD 3.0, could I programmatically attempt to resolve a Property Reference Error?
Here, color.font.tertiary attempts to link the value of
original: { value: '{color.base.grey.light.value}' },
and I'd like the opportunity to search fororiginal: { value: '{color.base.gray.light.value}' },
(The difference is 'grey' and 'gray').This is a simple example.
Where there is little control over a designers (or multiple designers in multiple departments) deeply nested Figma structures and decide to output to tokens via a plug-in, then
original: { value: '{rj-xxx.colors.palette.primary.400}' },
may be findable by reference after transforms by linking up tooriginal: { value: '{color.palette.black}' },
.Though, I'm not a fan of overwriting the original, just a quick example to be clear.