design-tokens / community-group

This is the official DTCG repository for the design tokens specification.
https://tr.designtokens.org
Other
1.56k stars 63 forks source link

A token value with multiple aliases #192

Open romainmenke opened 1 year ago

romainmenke commented 1 year ago

https://tr.designtokens.org/format/#aliases-references

There is no practical use within the current types but at the syntax level for aliases and references it is unclear if only a single or multiple tokens can be referenced?

{
  "hello": { "$type": "text", "$value": "hello" },
  "world": { "$type": "text", "$value": "world" },
  "hello-world": { "$value": "{hello} {world}" }
}

"{hello} {world}" : two other tokens are combined to form a single new value

I personally think this is best left up to users of design tokens to combine values. I think it is sufficient to be able to reference a single token in a single field.


Currently missing :

Only circular references have a mention.

Defining this in detail would make it more clear how implementations should behave.

kevinmpowell commented 1 year ago

Related to #200