Using filter to export multiple JSON files
I'm trying to export a single JSON file for all my color tokens, using the following config options:
{
"destination": "colors.json",
"format": "json/nested",
"filter": {
"attributes": {
"category": "color"
}
}
},
My tokens/color.json file looks like this (I've also tried nesting it under tokens/color/color.json :
{
"color": {
"surface":{
"background":{
"primary":{"value": "#FFFFFF"},
"secondary":{"value": "#F8F8F8"}
},
"card":{
"primary":{"value": "#F8F7F6"},
"secondary":{"value": "#FFFFFF"},
"disabled":{"value": "#D7D7D7"}
}
},
// etc.
}
When I run the build command, I see a note that No properties for colors.json. File not created.
What am I missing in my config file?
Are you targeting the correct file?
You mention that your file name is tokens/color.json (singular) but the error message reports colors.json (plural).
If not, can you copy all your configuration file?
@francinen How does the whole object in the config.json file look like?
@francinen did you still need help, or did these comments solve your issue?
@francinen Have you found solution to this? I am facing the same issue.