You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think having a Kotlin support would be awesome! Totally agree that having a more idiomatic integration would be great. The power of design tokens is that developers consuming them on different platforms should interact with them as if they were native to the platform.
If you have the time, you can open a PR to add transforms and formats to support Kotlin/Jetpack Compose. A good example PR is this one adding Flutter support: #320.
I noticed that @dbanksdesign's comment was posted in October before his recent contribution to Style Dictionary v3.0 which adds support for an android resources format. #509 (Thanks!)
When this Jetpack Compose feature is implemented, it would be great to offer similar functionality that creates Kotlin files based on a custom Filter. This allows developers to specify the type (String, Int, Color) and units (dp, sp, none) for their Style Dictionary setup.
Currently, the production version of the Style Dictionary is a bit lacking because the Android transformGroup requires your project to use color, size, etc as your top-level token category names. (I'm not sure if that is the case for other platforms). As the PR and related Issue notes, if your design system had a different naming convention, the result was that no tokens were generated in the output. I think it's still a nice feature to have for those who use it, but we should also continue to support the same functionality as #509 here, too.
@dbanksdesign I've been starting to look at this again, particularly with respect to colors and light/dark modes. I've also poked around at #399 and #307 . I'm interested in hearing your thoughts on how to make light/dark mode work for Compose.
Adding support for light/dark mode in the Android resource system should be fairly straightforward, since we can easily create separate colors.xml resource files in the values and values-night configurations.
Compose is a bit of a different beast- in a perfect Compose world we wouldn't be touching resources at all and all our colors would be defined in Kotlin files.