[Bug]: Combination of `expand: { typography: false }` & `outputReferences` causes CSS-vars formatting to break
Closed this issue · 1 comments
What happened?
When transforming tokens coming from the Tokens Studio plugin, we are running into problems with the combination of:
expand: { typography: false }
& outputReferences
I'm just guessing, but it seems to be related to the token name containing the character 0
(zero) when being used within a reference.
{
"Font": {
"LineHeight": {
"10": { // <- this is causing the problems when being referenced ❌
"value": "10",
"type": "lineHeights"
},
"11": { // <- this is fine ✅
"value": "11",
"type": "lineHeights"
}
}
"Headline": {
"L-XL": {
"Large": {
"value": {
...
"lineHeight": "{Font.LineHeight.10}", // <- this will result in a broken output ❌
...
},
"type": "typography"
},
Reproduction
Expected output
--sd-font-headline-l-xl-large: var(--sd-font-weight-arial-company-headline-regular) var(--sd-font-size-10)/var(--sd-font-line-height-10) var(--sd-font-family-arial-company-headline);
Version
^0.11.6
Hey, this is related to outputReferences in general not working very well. I did actually improve outputReferences in style-dictionary very recently, I'll talk with the other maintainer to see if we can do a release of style-dictionary v3, then I have to do a subsequent patch of browser-style-dictionary patch, and then I expect this use case to work better.
See also:
#121
amzn/style-dictionary#974
Closing this, as it is essentially a duplicate of #121 which will remain open until we do the v3 release and browser-style-dictionary patch as well, so best to track that issue