Re: [community-group] Themes/Schemes vs. Design Tokens (#187)

@equinusocio I want to acknowledge that while the principles of design tokens you shared are good principles, they aren't in the current definition of this specification, so it's hard to be precise about whether they are or are not correctly applied.

Like @PavelLaptev says, we take advantage of the features of JSON to prevent tokens from having ambiguous values. The following is not valid JSON, and therefore it's not a valid token file:

```js
{
  "color-500": {
    "$value": "#ff00ff",
    "$type": "color"
  },
  // later in the file ...
  "color-500": {
    "$value": "#00ff00",
    "$type": "color"
  }
}
```

This isn't valid JSON, either:

```js
{
  "link-color": {
    "$value": "{color.500}"
  },
  // later in the file ...
  "link-color": {
    "$value": "{color.200}"
  }
}
```

So within an implementation there shouldn't be any issue. Of course there's no perfect guarantee, and the more complex a system is the more likely there will be bugs. Actually. your example lays out a good principle of best practice to avoid bugs: always use aliases, don't try to modify the underlying value.

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


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

Received on Wednesday, 30 November 2022 20:46:21 UTC