Closed IanVS closed 6 months ago
I'm experimenting with setting up style-dictionary, so my apologies if this is a config error. I'm using the DTCG format, and trying to preserve references in the generated css. But, it seems that the reference is not kept.
See this reproduction to see an example:
https://stackblitz.com/edit/stackblitz-starters-3dyujd?file=variables.css&view=editor
Token file:
{ "color": { "$type": "color", "base": { "gray": { "__default": {"$value": "{color.base.gray.50.$value}"}, "10" : { "$value": "#16191d" }, "15": { "$value": "#21252c" }, "20" : { "$value": "#2b323b" }, "30" : { "$value": "#414b58" }, "40" : { "$value": "#576475" }, "50" : { "$value": "#6c7d93" } } } } }
config:
{ "source": ["tokens/**/*.json"], "platforms": { "css": { "transformGroup": "css", "files": [ { "format": "css/variables", "destination": "variables.css", "options":{ "outputReferences": true } } ] } } }
result:
:root { --color-base-gray-default: #6c7d93; --color-base-gray-50: #6c7d93; --color-base-gray-40: #576475; --color-base-gray-30: #414b58; --color-base-gray-20: #2b323b; --color-base-gray-15: #21252c; --color-base-gray-10: #16191d; }
This is probably an oversight, something we didn't test for when adding DTCG support. Will look into it!
Fixed in prerelease.19
I'm experimenting with setting up style-dictionary, so my apologies if this is a config error. I'm using the DTCG format, and trying to preserve references in the generated css. But, it seems that the reference is not kept.
See this reproduction to see an example:
https://stackblitz.com/edit/stackblitz-starters-3dyujd?file=variables.css&view=editor
Token file:
config:
result: