suffix-by
This parser helps you suffix the name of your collections, groups and tokens from your SDTF token tree.
Last updated
Was this helpful?
Was this helpful?
| { collection: string | true }
| { group: string | true }
| { token: string | true }
| SDTFQuery{
"spacing": {
"1": {
"$type": "dimension",
"$value": {
"default": {
"value": 4,
"unit": "px"
}
}
}
},
"colors": {
"black": {
"$type": "color",
"$value": {
"default": {
"model": "hex",
"hex": "#000000",
"alpha": 1
}
}
}
}
}{
"version": "2",
"repository": "@organization/repository",
// Only use the personalAccessToken when working with the CLI
"personalAccessToken": "<your-personal-access-token>",
"rules": [
{
"name": "Prefix color tokens",
"parsers": [
{
"name": "suffix-by",
"options": {
"token": "-color",
"applyTo": {
"where": {
"token": ".*",
"withTypes": {
"include": [
"color"
]
},
"select": {
"parents": true
}
}
}
}
},
{
"name": "to-sdtf",
"output": {
"type": "file",
"filePath": "tokens.json"
}
}
]
}
]
}{
"colors": {
"black-color": {
"$type": "color",
"$value": {
"default": {
"model": "hex",
"hex": "#000000",
"alpha": 1
}
}
}
},
"spacing": {
"1": {
"$type": "dimension",
"$value": {
"default": {
"value": 4,
"unit": "px"
}
}
}
}
}