amzn / style-dictionary

A build system for creating cross-platform styles.
https://styledictionary.com
Apache License 2.0
3.77k stars 527 forks source link

Add font example and transforms/formats #266

Open dbanksdesign opened 5 years ago

dbanksdesign commented 5 years ago

Show how to use font tokens to set up custom fonts and font-related values in a Style Dictionary. For example:

chazzmoney commented 5 years ago

+1 on this

radium-v commented 5 years ago

Hello there,

I wrote a custom formatter that does this.

Formatter: https://github.com/jwplayer/jw-design-library/blob/master/scripts/formatters/font-face.js Dictionary: https://github.com/jwplayer/jw-design-library/blob/master/dictionary/properties/font/font-face.yaml

We're doing a bunch of other weird things (like converting the TTF to WOFF and WOFF2 at build time, and we're overriding the require function to load yaml files instead of json) but I hope this might be useful for others.

dbanksdesign commented 5 years ago

Shut the front door. You are blowing my mind right now. 🤯

I'm going to poke around your code a bit. We have been thinking about Yaml support for a while, it might be time to add that in. It might be cool if you could contribute some of what you are doing with fonts into some of the built-ins. We are also thinking about a plugin architecture so people could release a plugin that adds formats, transforms, actions, other functionality so we don't have to keep adding things into the core library. This might be a good candidate for that too. Either way, super exciting what you are doing!

Pinch1A commented 3 years ago

any news on this ?

dbanksdesign commented 3 years ago

Unfortunately no :/ I haven't had time to spend on this. But if you look at what @radium-v posted, that would be a good place to start.

amarunko commented 2 years ago

any updates on this?