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

fix: outputReferences to use original.value when possible #1002

Closed jorenbroekema closed 1 year ago

jorenbroekema commented 1 year ago

Issue #, if available: https://github.com/amzn/style-dictionary/issues/974

Description of changes: As suggested in the issue, change the replacing of values with references to use original.value instead of ref.value (which could have gotten transformed in the meantime), whenever possible, as this will create a more accurate output when the ref.value has been changed to a point where using that as a replacer reference is no longer possible.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.