mikaelvesavuori / figmagic

Figmagic is the missing piece between DevOps and design: Generate design tokens, export graphics, and extract design token-driven React components from your Figma documents.
https://docs.figmagic.com
MIT License
807 stars 71 forks source link

Token names exported in camelcase #148

Closed mikaelvesavuori closed 2 years ago

mikaelvesavuori commented 2 years ago

Discussed in https://github.com/mikaelvesavuori/figmagic/discussions/147

Originally posted by **glouhaichi** November 3, 2021 We are experimenting with Figmagic in our project to export tokens created in our Figma files. The names in the figma files are using kebab case (ex. `$ixc-cognira-opacity-error500-005`), but after importing the tokens in the project with `npm run figmagic`, the names change to camel case (ex. `ixcCogniraOpacityError500005`). As you can see, the case has changed and the `$` sign is gone. This presents an issue for us because we are using a naming convention where each name consists of 5 parts, and trying to decmopose the name into its constituants is impossible in the case of the example above (no way to know at which point to chop the number). Is there a way to export the names in their original case? I scoured through the documentation but have not found a way around this. Am I missing a setting or is this not possible?
mikaelvesavuori commented 2 years ago

This is now released in version 4.3.7. See the docs at https://github.com/mikaelvesavuori/figmagic#do-not-transform-camelize-token-names