Re: [community-group] Can groups be a property? (#122)

I think it's unreasonable to assume that tokens files will only be generated or edited by machines. I wouldn't be surprised at all if token files ended up being generated by hand the *majority* of the time, especially in the first couple of years while the number of spec-compliant token tools is zero or very few.

For a flat list to work, the token name would have to include the full group name, not as a separate property.

```json
{
  "token uno": { "$value": "token value 1" },
  "token group.token dos": { "$value": "token value 2" },
  "token group.nested token group.token tres": { "$value": "token value 3" }
}
```

Otherwise, you'd have conflicts in every token file that had two tokens with the same name in two different groups, which would be... probably almost every token file. (For example, `token uno` versus `token group.token uno` couldn't be specified in your proposed format, right?)

And true, that would be easier to parse, but also considerably more cumbersome to write, and the number of people writing code to parse tokens is likely very low compared to the number of people writing token files, so that seems like a bad tradeoff to me. It also closes off various potential future features like aliasing or extending groups.

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


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

Received on Friday, 25 March 2022 20:22:31 UTC