amzn / style-dictionary

A build system for creating cross-platform styles.
https://amzn.github.io/style-dictionary/#/
Apache License 2.0
3.72k stars 523 forks source link

Compose UI Multiplatform support #1111

Open kirillzh opened 4 months ago

kirillzh commented 4 months ago

Compose UI Multiplatform 1.6.0 added a common resources API to manage strings, fonts, drawables, etc: https://blog.jetbrains.com/kotlin/2024/02/compose-multiplatform-1-6-0-release/#common-resources-api.

It would be great if we could generate tokens in Compose UI Multiplatform using this new API.

jorenbroekema commented 1 month ago

@nhoizey hey, would love to get your 2 cents on this, I know your current PR is related to XML outputs and this multiplatform format seems to be different, but perhaps we could start an initiative to add this to style-dictionary.

Let's start in a similar way to your PR: https://github.com/amzn/style-dictionary/pull/1173, getting a bunch of design tokens of all types and creating a snapshot of what the desired output would look like, then we can start thinking of which transforms we'll need per token type and what the compose/multiplatform format would look like. Feel free to draft a PR, which can be similar to this https://github.com/amzn/style-dictionary/pull/1173

nhoizey commented 1 month ago

It would be great to have larger support for different formats indeed.

Unfortunately, I'm not myself an Android developer, and the one I'm working with only using XML resource files, not Jetpack Compose at all, so I'm not sure I can help.

@kirillzh would you be able to create a PR similar to my #1173 but for Jetpack Compose?