style-dictionary
style-dictionary copied to clipboard
Transitive transforms do not work well with references that don't have `.value` at the end
When you use references that do not contain .value at the end transitive transforms do not work as expected.
In the transitive transforms example, when you swap out token references from {color.font.primary.value}
to {color.font.primary}
output changes so that it does not include the resolved previous reference.
Expected output:
--color-font-primary: #000000;
--color-font-secondary: #2c2c2c;
--color-font-tertiary: #555555;
Actual output:
--color-font-primary: #000000;
--color-font-secondary: #2c2c2c;
--color-font-tertiary: #2c2c2c;
Another example:
"fontFamilies": {
"open-sans": {
"value": "Open Sans",
"type": "fontFamilies"
}
},
...
"H1": {
"fontFamily": {
"value": "$fontFamilies.open-sans",
"type": "fontFamily"
},
...
Output:
$font-families-open-sans: Open Sans;
$h1-font-family: $fontFamilies.open-sans;
$h1-font-weight: $fontWeights.open-sans-0;
$h1-line-height: $lineHeights.0;
...
Looks like this issue has been fixed for a bit. Closing for now, please re-open if the issue is still occurring.