terrazzoapp / terrazzo

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

Accept array of shadow from Token Studio #252

Open rlebascle opened 3 months ago

rlebascle commented 3 months ago

The Token Studio parser/converter doesn't accept an array of shadows as a valid value.

{
  "layered-shadow": {
        "value": [
          {
            "x": "0px",
            "y": "62px",
            "blur": "37px",
            "spread": "0px",
            "color": "#42250505",
            "type": "dropShadow"
          },
          {
            "x": "0px",
            "y": "27px",
            "blur": "27px",
            "spread": "0px",
            "color": "#42250508",
            "type": "dropShadow"
          },
          {
            "x": "0px",
            "y": "7px",
            "blur": "15px",
            "spread": "0px",
            "color": "#4225050a",
            "type": "dropShadow"
          }
        ],
        "type": "boxShadow"
      },
     "$themes": [],
  "$metadata": {}
}

is giving me the following CSS

--layered-shadow: 0 0 0 0 #000000;

The issue seems to be around here https://github.com/drwpow/cobalt-ui/blob/main/packages/core/src/parse/tokens-studio.ts#L323

Let me know if you want me to try to do a fix.

Anyway thanks for your awesome library !