Closed fwielstra closed 3 months ago
What format are you using for the output? javascript/object
perhaps?
Some of the formats seem to just JSON.stringify()
the dictionary and not take into account the name
of the token at all, so even if name transforms apply, the output won't care about them.
This isn't a sd-transforms issue though but rather a style-dictionary issue, could you create an issue there? I think the solution is to give the JSON.stringify methods a replacer function that alters the keys to the token name if such a prop exists. Preferably for all of the formats that use this type of approach for writing the output. It would be a breaking change but since I'm working on v4 I'd be down to include it in v4
Closed due to inactivity and no follow up on the SD repo.
What happened?
In the source tokens there's a few keys in
kebab-case
, which we'd like to convert tocamelCase
in the output.I believe the documentation says that it's a matter of setting the
casing
option tocamel
, but this does not seem to work.I've also tried to use a custom
name
transformation that detects and converts the name, but maybe I'm missing something obvious or small.Reproduction
The transforms and configuration that I use:
Using the power of
console.log
in the matcher and transformer functions, I can see that keys liketext-case
,border-radius
andsoforth are converted totextCase
andborderRadius
, however, the output JSON still retains the existing kebab-case:Input exertpt:
Output exerpt:
Expected output
Version
0.11.10