Skip to content

Instantly share code, notes, and snippets.

@didoo
Created April 20, 2020 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save didoo/cb01bd4d0bbb4b1569366b3a8df063ed to your computer and use it in GitHub Desktop.
Save didoo/cb01bd4d0bbb4b1569366b3a8df063ed to your computer and use it in GitHub Desktop.
Answer in Medium article on Design Tokens - Approach B
{
"source": ["tokens_desktop/spacing.json", "tokens_button.json"],
"platforms": {
"desktop": {
"transformGroup": "desktop",
"buildPath": "build/desktop/",
"files": [{
"destination": "tokens.ext",
"format": "my/format"
}]
}
}
}
{
"source": ["tokens_mobile_spacing.json", "tokens_button.json"],
"platforms": {
"mobile": {
"transformGroup": "mobile",
"buildPath": "build/mobile/",
"files": [{
"destination": "tokens.ext",
"format": "my/format"
}]
}
}
}
{
"button": {
"text-icon-spacing": {
"value": "{spacing.lg.value}",
"type": "size"
}
...
}
}
{
"spacing": {
"sm": {
"value": "4",
"type": "size"
},
"md": {
"value": "8",
"type": "size"
},
"lg": {
"value": "12",
"type": "size"
},
"xlg": {
"value": "16",
"type": "size"
}
}
}
{
"spacing": {
"sm": {
"value": "2",
"type": "size"
},
"md": {
"value": "4",
"type": "size"
},
"lg": {
"value": "8",
"type": "size"
},
"xlg": {
"value": "12",
"type": "size"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment