mark-nicepants / figma2flutter

Converts design token json files to flutter
Apache License 2.0
17 stars 16 forks source link

[BUG] Negative numbers (`-`) in a size name isn't supported (Low Priority) #33

Closed kvenn closed 6 days ago

kvenn commented 2 weeks ago

:information_source: Info

Version: v0.3.0-beta

:speech_balloon: Description

If there are two values, one with the name 4 and the other with the name -4, the generator will generate them both as

EdgeInsets get globalSpacing4 => const EdgeInsets.all(4);
EdgeInsets get globalSpacing4 => const EdgeInsets.all(-4);

Suggestion

Replace the - with neg or negative

EdgeInsets get globalSpacing4 => const EdgeInsets.all(4);
EdgeInsets get globalSpacingNegative4 => const EdgeInsets.all(-4);

:scroll: tokens file you tried to import

{
  "global": {
    "spacing": {
      "-4": {
        "value": "-4",
        "type": "spacing"
      }
      "4": {
        "value": "4",
        "type": "spacing"
      }
  }
}
freemansoft commented 6 days ago

https://github.com/mark-nicepants/figma2flutter/pull/38 has been merged