Style-dictionary: Generating files with same folder/files hierarchy as inputs

Created on 7 May 2021  路  8Comments  路  Source: amzn/style-dictionary

I wanted to generate multiple target files with the same hierarchy of folders and files as my input files in properties/.

I tried to use the matching-build-files example, but it looks like the folder/files hierarchy it builds is mapped on the CTI hierarchy, not the one of the files in which the properties are defined.

I think the two needs can be relevant, and the example provides one of them, while presenting itself as providing also the other.

This is right:

1:1 relationship between build files and token categories

But the title doesn't seem to be:

generate separate build files that match your folder structure

I can:

  • make a PR to change the title of the matching-build-files example, and maybe add some details about the actual use case
  • try to build another example that provides what I currently want, mapping of folders/files instead of CTI

All 8 comments

@kharrop what do you think?

That makes total sense! In my example my categories happened to match so I see how that's misleading. An example that matches folder structure would be awesome!

Lets do it

Ok, I have something that now works well in my project, I will extract an example and open a PR! 馃憤

Any relationship to #253 ?

I like #253 a lot!

But it's not directly related, as it deals with input, whereas I'm trying to deal with output.

I might find time to work on this before the end of the week, should I base my PR on branch main or 3.0(or another)?

Base it off main

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dbanksdesign picture dbanksdesign  路  3Comments

valiksb picture valiksb  路  4Comments

dbanksdesign picture dbanksdesign  路  5Comments

chazzmoney picture chazzmoney  路  4Comments

chazzmoney picture chazzmoney  路  4Comments