Parabeac / parabeac_core

Continuous Design / Continuous Integration for Figma to Flutter
BSD 3-Clause "New" or "Revised" License
579 stars 70 forks source link

Improper name formatting of Global Styles #718

Open ivan-015 opened 2 years ago

ivan-015 commented 2 years ago

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:

rajarshi-ch commented 2 years ago

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

ivan-015 commented 2 years ago

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