Principles
- For core properties (name, value, description…), a design token file must be both human-editable and human-readable
- The format is simple, extensible, and as unopinionated as possible
- Vendors (design system tools, design tools…) can store information for their own usage, both globally and for each token
- The format translates well to existing design tools, in order to facilitate adoption
v1 priorities
- Agreement and adoption by several design tools
- Define core use-cases
Inspiration
Proposal
At the moment, this proposal doesn't advocate for a particular file format (JSON, TypeScript…), it merely discusses what the shape of it should look like.
interface TokenList {
// Where tokens are stored (in an array)
tokens: Token[];
// is this useful? should it be optional or not?
version?: string;
// Optional metadata
data?: Data;
// What other global properties are needed? (type, category, group…)
}
interface Token {
name: string;
value: any;
description?: string;
data?: Data;
// What other properties are needed? (type, category, group…)
}
interface Data {
// Vendor-prefixed data
// for example: `data: { vendor: { "@sketch": {} } }`
vendor?: object;
// Any number of additional properties can live here,
// for example, for storing additional information related to the token
}
Example
{
tokens: [
{
name: 'Foo',
value: 'Bar'
},
{
name: 'I am a token',
value: 'This is a value',
description: 'A nice description.',
data: {
myOwnFlag: true,
oneMoreThing: 'yay'
vendor: {
'@sketch': {
// ...
},
'@figma': {
// ...
}
}
}
}
],
data: {
vendor: {
'@sketch': {
// ...
},
'@figma': {
// ...
}
}
}
}
Principles
v1 priorities
Inspiration
Proposal
At the moment, this proposal doesn't advocate for a particular file format (JSON, TypeScript…), it merely discusses what the shape of it should look like.
Example