Support for Android Jetpack Compose
See original GitHub issueJetpack Compose is the future of Android UI development, and I’d love to see first-class support for Compose in style dictionary.
While Jetpack Compose has an interop layer with style resources, I would love to see a more idiomatic integration.
For example, today with Compose + Style Dictionary we could do:
@Composable
fun TextExample() {
Text(
text = "Hello World",
color = colorResource(R.color.color_font_base)
}
But I would much rather have Style Dictionary generate a Kotlin file containing the colors so we can have something like this:
@Composable
fun TextExample() {
Text(
text = "Hello World",
color = StyleDictionary.colors.font.base
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Jetpack Compose UI App Development Toolkit
Jetpack Compose is Android's recommended modern toolkit for building native UI. It simplifies and accelerates UI development on Android.
Read more >Quick start | Jetpack Compose
Create a new app with support for Compose; Set up Compose for an existing app; Try Jetpack Compose sample apps; Using the Bill...
Read more >Android Studio support for Compose | Jetpack Compose
Android Studio offers some features to extend composable previews. You can change their container design, interact with them, or deploy them ...
Read more >Adding Jetpack Compose to your app
If you want to use Jetpack Compose in an existing project, you'll need to configure your project with required settings and dependencies.
Read more >Get started with Jetpack Compose
Jetpack Compose is the modern toolkit for building native Android UI. Here's where you'll find the latest information about using Compose.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My team is using the style dictionary and is also interested in first-class Jetpack Compose support. Bumping this thread in case anyone is able to prioritize it.
I took a swing at what a format that supports dark mode in Compose might look like based on your work-in-progress dark mode repo:
https://gist.github.com/bherbst/1b8c9a66953f25044631db68dd773429
There’s a bit of awkward juggling to get the references to the
Palette
object when constructing the light/darkColors
objects, but overall I think it is workable.