style-dictionary icon indicating copy to clipboard operation
style-dictionary copied to clipboard

Unable to run a transform on a value from reference

Open The-Code-Monkey opened this issue 1 year ago • 2 comments

So im doing this

"primary": {
   "value": "{color.common.brand.primary.value}",
   "makeShades": true
}

The makeShades bool is a custom prop for my generate function to match and then do a transform on, it works fine when i put an actual value in the value prop, but if you put a reference like above it just completely skips all the transforms, how do i get it to pull the reference for that value first then run the transforms on the color??

This is kindof a strange situation but I cant work out why it wouldn't be setup to do references first then transforms.

The-Code-Monkey avatar Sep 06 '22 09:09 The-Code-Monkey

In your custom transform, can you try with "transitive: true"? Reference: https://amzn.github.io/style-dictionary/#/transforms?id=transitive-transforms

I just recently made a color adjustment transform too (for pressed / disabled / hovers) and scratched my head over this. 😅

nahiyankhan avatar Sep 07 '22 16:09 nahiyankhan

I will try tomorrow cheers

The-Code-Monkey avatar Sep 07 '22 17:09 The-Code-Monkey