design-token-transformer icon indicating copy to clipboard operation
design-token-transformer copied to clipboard

Flutter support

Open aloisdeniel opened this issue 2 years ago • 6 comments

Hi,

First, thanks a lot for these great tools!

I just wanted to share a set of custom transformers I did for my own needs with Flutter, which could be interesting to improve your official transformer package.

Everything is available here : style-dictionary-figma-flutter.

It basically outputs tokens as a Flutter theme widget with a few helpers.

I also added a custom-icon type to export vector paths from Figma too (I made a custom plugin that clones my icon frames, flattens them as a single path, and then exports it as json).

aloisdeniel avatar May 02 '22 05:05 aloisdeniel

Hey @aloisdeniel,

this is great. Sadly the link seems to be broken.

Would you be willing to add it to this package? If you could send a PR with a build.js here: https://github.com/lukasoppermann/design-token-transformer/tree/main/examples

Maybe /flutter/build.js

And the custom transformers in src/flutter? (https://github.com/lukasoppermann/design-token-transformer/tree/main/src)

If you have anything for the readme, that would also be interesting.

lukasoppermann avatar May 02 '22 09:05 lukasoppermann

Oh sorry, I forgot to change the repository visibility. It should be accessible now!

I've followed the same logic/structure as the style-dictionary code base which is a bit different from this repository (lodash template, ...). I'll see if I can adapt it to create a PR.

aloisdeniel avatar May 02 '22 09:05 aloisdeniel

If you need any support, please let me know. 🙏

lukasoppermann avatar May 02 '22 09:05 lukasoppermann

And what is your thought about adding icon vector tokens into Design Tokens as well?

aloisdeniel avatar May 02 '22 11:05 aloisdeniel

@aloisdeniel this is definitely interesting. However I am currently not sure how this would best work. What is your approach here?

lukasoppermann avatar May 02 '22 11:05 lukasoppermann

It is very specific to Flutter, but I'm outputting a path like that from json entries like this one. It is lot more performant than SVG assets for example.

Theoretically, I could also do a similar generation from SVG assets, but SVG is so permissive that it is not possible. I find it great to have a design standard for glyphs like that.

aloisdeniel avatar May 02 '22 13:05 aloisdeniel

While an interesting idea, I currently don't have time to look into this.

lukasoppermann avatar Aug 16 '22 07:08 lukasoppermann