[community-group] How to do tokens that share a name with a group (#97)

c1rrus has just created a new issue for https://github.com/design-tokens/community-group:

== How to do tokens that share a name with a group ==
A question that's come up a few times in various discussion and for which the current spec draft doesn't really have an answer is this: How can you have design tokens that share the same name as a group?

For example, imagine you wanted to author a token file that could be exported to SASS like this:

```scss
$color-accent: #dd0000;
$color-accent-light: #ff2222;
$color-accent-dark: #aa0000;
```

...and you wanted to use groups to organise your token file. You could create a `color` group, with an `accent` group inside it and put your `light` and `dark` tokens in there. But then, where does the token that gets exported as `$color-accent` go?

```jsonc
{
  "color": {
    "accent": {
      "light": {
        "type": "color",
        "value": "#ff2222"
      },
      "dark": {
        "type": "color",
        "value": "#aa0000"
      }

      // Does the token go here, inside the "accent" group? If so, what is it called?
    }

    // Or does the "accent" token go here, but then how do we prevent the
    // name clash with the "accent" group?
  }
}
```

This issue came up at the last format editors' meeting and we feel like this is something our format should support in some way. Also, debating this issue may generate some ideas or highlight considerations that could be useful for the "reserved words" discussion over in issue #61.

We'd love to hear your thoughts and ideas on this!



Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/97 using your GitHub account


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

Received on Wednesday, 12 January 2022 22:17:45 UTC