Parabeac/parabeac_core

Improper name formatting of Global Styles

ivan-015 opened this issue · 2 comments

Describe the bug

Global Styles in Figma have wide flexibility in the naming. As such, Figma allows me to name my global styles something like 012 My Style. This is a problem because parabeac_core will export this style name as a variable named 012myStyle.

The goal of this issue is to correctly format color names in such a way that we remove any invalid special characters, and move any initial numbers in the variable name to the end of the variable.

Therefore, 012my$Style shall convert to myStyle012.
If we detect a global style with a name such as 500we shall change it to <styleType>500. For example, if we have a Global Color named 500, the name will change to color500.

To Reproduce the bug

Steps to reproduce the behavior:

  1. Go to figma.com and create a new Design file.
  2. Create a global color, named something like 012myColor.
  3. Using parabeac_core, convert the file.
  4. You should see that in the themes folder, there is an error because the global color printed out its literal name.

Impact of the problem

The problem is that the bug causes compiler errors that will not allow users to run their project.

Environment:

  • OS: macOS

Hey. Can I have it assigned to me. @Rockfist from discord here.

@rajarshi-ch Done! Thanks, let us know if you run into any issues or need any help.