Closed peschee closed 9 months ago
Maybe related to #936, more specifically this comment: https://github.com/amzn/style-dictionary/issues/936#issuecomment-1428654401
https://github.com/amzn/style-dictionary/blob/main/lib/common/formatHelpers/createPropertyFormatter.js#L207 this is the line of code that causes that to happen, and the reason is because asset paths tend to need to be wrapped in string quotes in order to work for CSS/web context.
e.g.
:root {
--alert-circle: assets/icons/alert-circle.svg;
}
doesn't work but:
:root {
--alert-circle: "assets/icons/alert-circle.svg";
}
does work.
Right now, Style-Dictionary still relies on token hierarchy/taxonomy to determine the type of the token, using the "attribute/cti" transform to add the CTI attributes metadata.
This is something that I will change in a breaking change in v4, where the token type is always determined by the token.type
/token.$type
property.
Right now to work around this issue:
Other than that there is no way to configure it
https://github.com/amzn/style-dictionary/issues/1082 you can track this issue btw
Given this example tokens:
and this configuration:
I end up with the following output:
It seems that numeric values for asset tokens are always being quoted. Is there a way to customize this?
A small repro is here: https://stackblitz.com/edit/style-dictionary-example-cf6bcc