Re: [community-group] colorPalette composite type (#178)

Recently I've been diving deeper into Figma plugins to export tokens (currently 'Design Tokens') and then formatting to the desired output by custom parsers/transforms/filters in StyleDictionary. As @PavelLaptev suggests, I put SemanticWeighted (base) colors in a group called palette.

```
{
  "color": {
    "palette": {
      "primary": {
        "primary015": {
          "$type": "color",
          "$value": "#f6f8f6ff"
          }
        },
        "primary025": {
          "$type": "color",
          "$value": "#eef1efff"
          }
        },
        "primary050": {
          "$type": "color",
          "$value": "#dde4dfff"
          }
        }, ...
```

With a StyleDictionary parser, I can see these are semantic and can map to contextual colors (replacing the hex values optimistically).

```
{
  "color": {
    "contextual": {
        "light": {
            "brandBackground10": {
              "$type": "color",
              "$value": "{primary015}",
          },...
        "dark": {
            "brandBackground10": {
              "$type": "color",
              "$value": "{primary800}",
          }
```

Overall, I suspect any further 'optimization' of structure would tend to be prescriptive to doing things a certain way. And if I had to be opinionated, I'd lean towards being as flat as possible where it comes to 'primitive' tokens.

-- 
GitHub Notification of comment by caoimghgin
Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/178#issuecomment-1311586776 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 11 November 2022 11:35:49 UTC