terrazzoapp / terrazzo

Use DTCG tokens JSON to generate code for web, mobile, native apps, and more
https://terrazzo.app
MIT License
153 stars 27 forks source link

Error when token $value is negative value #282

Closed mikeokijohn closed 2 months ago

mikeokijohn commented 2 months ago

Hello!

Thanks for the great work on implementing terrazzo :)

We are using it to transform our design tokens from Figma Variables to css variables, using the latest Figma API. When running the tz build task, we encounter the following error for a token that has a "negative" $value:

image

The token looks like this, when delivered using the TokensBrücke Figma plugin:

"neg-3": {
        "$type": "dimension",
        "$value": "-0.029999999329447746px",
        "$description": "letter-spacing: -3%",
        "$extensions": {
          "mode": {},
          "figma": {
            "variableId": "VariableID:2965:644",
            "collection": {
              "id": "VariableCollectionId:2963:612",
              "name": "Typography",
              "defaultModeId": "2963:0"
            }
          }
        }
      },

Is this error expected, so terrazzo is not able to handle tokens that has negative values?

FYI:

We are currently investigating moving from Cobalt to Terrazzo, so both projects are installed in our application. Should that be an issue?

Thanks again!

drwpow commented 2 months ago

Nope! This is a bug that should be fixed. Will fix and push a release later this week

drwpow commented 2 months ago

Fixed, and released! Sorry for the delay on this. Let me know if you’re still experiencing the issue!