Re: [community-group] Token name - reserved words (#61)

@c1rrus 
> There's a bunch of property names that have a special meaning in our spec, so I believe these necessarily need to be reserved words: `value`, `type`, `description`, `extensions`...

This could be avoided, as you suggested, with some prefix like $, so only `$value` is special and `value` could be a valid token name. But as you also pointed out accessing things like `token['$value']` instead of `token.value` is not so nice.

Another way would be to add just one special keyword `tokens`.

```js
{
  "description": "The description of this group",
  "value": "just a custom property"
  "tokens": {
    "any word can be a token name": {
        "value": "100px",
        "type": "dimension"
    },
    "value": { 
        "value": "#abcdef",
        "type": "color",
        "description": "this token is used for item value"
    },
    "description": {
        "value": "#ffffff",
        "type": "color",
        "description": "this token is used for description texts"
    }
  }
}
```

Root level tokens would also not need any exception if we threat `mysystem.tokens` just as we treat `tokens`.

```js
{
    "token name": {
        "value": "100px",
        "type": "dimension"
    },
    "value": { 
        "value": "#abcdef",
        "type": "color"
    },
    "description": { 
        "value": "#ffffff",
        "type": "color"
    }
  }
```

I wrote a maybe too big example in https://github.com/design-tokens/community-group/issues/55#issuecomment-925897880


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


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

Received on Friday, 29 October 2021 10:02:04 UTC