Style-dictionary: Using curly braces {} for templating content

Created on 7 Oct 2019  ·  5Comments  ·  Source: amzn/style-dictionary

One of the consumers of our system uses curly braces for content replacement in strings.

Due to the way that SD currently uses curly braces in the build process there is no way I can have a string that includes the braces for consumption.

I have tried a number of ways to escape the braces with no luck

Other languages and templating systems seem to use the concept of using double curly braces to handle this scenario.

It could be a way that SD could also handle it but am open to anything else that would allow the scenario to be achieved

e.g.
screenHeadingContent: {value: "Welcome's to the {{0}} screen"}

would build to

screenHeadingContent: "Welcome's to the {0} screen"

good first issue hacktoberfest help wanted

All 5 comments

🙌 Hi @dbanksdesign @custa1200 ,

I'm new to this repository. I'd like to take on this issue. If you guys could give me more context on how this could be resolved - that'd be great!

Thanks!

For further example if the consumer using function arguments with curly braces can be found at: http://www.zingstudio.io/doc/String.html#function-arg-any-value-→-string

Let me know if you want any other info

@custa1200 I get the idea that you're suggesting here but I'm a little confused on how and where to start implementing this in this repository/code. Since I'm new to this Style Dictionary repository.

Can I take this issue if no one is working on it?

@creatorpiyush absolutely! (sorry for the delayed response) 🐌

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dbanksdesign picture dbanksdesign  ·  3Comments

blackfalcon picture blackfalcon  ·  4Comments

dbanksdesign picture dbanksdesign  ·  5Comments

nhoizey picture nhoizey  ·  4Comments

tlouisse picture tlouisse  ·  4Comments