amzn / style-dictionary

A build system for creating cross-platform styles.
https://styledictionary.com
Apache License 2.0
3.87k stars 543 forks source link

was not able to recognize the dynamic value #942

Closed catherinekennedy closed 1 year ago

catherinekennedy commented 1 year ago

Hi when I try to integrate the tokes.json file in style-dictionary Im facing error like this saying,

Reference doesn't exist: core.dimension.sm.value tries to reference dimension.xs, which is not defined.

But in tokens.json file "dimension": { "scale": { "value": "2", "type": "dimension" }, "xs": { "value": "4", "type": "dimension" }, "sm": { "value": "{dimension.xs} {dimension.scale}", "type": "dimension" }, "md": { "value": "{dimension.sm} {dimension.scale}", "type": "dimension" }, "lg": { "value": "{dimension.md} {dimension.scale}", "type": "dimension" }, "xl": { "value": "{dimension.lg} {dimension.scale}", "type": "dimension" } }, the problem is style-dictionary was not able to recognize the dynamic values, can I know how to solve this?

argdesign commented 1 year ago

What is the output you are trying to get?

Sidnioulz commented 1 year ago

Try to reference {core.dimension.md} and so on instead. I deduced this from the fact that the token which fails to build is named core.dimension.sm.

catherinekennedy commented 1 year ago

Try to reference {core.dimension.md} and so on instead. I deduced this from the fact that the token which fails to build is named core.dimension.sm.

ya solved this error by installing token transformer