Open Javernus opened 2 years ago
Has there been any focus on this issue?
I recently encountered a similar issue. As mentioned in the other referenced issue, I believe the problem area is related to https://github.com/amzn/style-dictionary/blob/main/lib/common/formatHelpers/createPropertyFormatter.js#L115
Specifically, when resolving references and updating the content of the value
property.
In your example the string would start out as:
#000000 0
My understanding is that Style Dictionary works backwards and resolved each value to it's top level reference. So on the first pass the string would be updated to:
var(--color-10), 0
Then it attempts to call JavaScript's string.replace
function on this string, attempting to replace the value 0
with the referenced token opacity-0
. This results in the unexpected out:
var(--color-1var(--opacity-0), 0
Where the first instance of the string 0
has been replaced with what Style Dictionary believes is its referenced token name.
I came across a weird behaviour when working with
outputReference
. The output seems to be bugged. Here is a config to recreate the issue:Here is the output token
test
for this code for both css and scss exports:As is clear, this is incorrect. I would expect this:
I tested this on version 3.7.1.