airbnb / Showkase

🔦 Showkase is an annotation-processor based Android library that helps you organize, discover, search and visualize Jetpack Compose UI elements
https://medium.com/airbnb-engineering/introducing-showkase-a-library-to-organize-discover-and-visualize-your-jetpack-compose-elements-d5c34ef01095
Apache License 2.0
2.1k stars 107 forks source link

Provide the custom background color from @Preview in the metadata #295

Closed micHar closed 1 year ago

micHar commented 1 year ago

If I have a white component, in my previews I show it against non-white background with sth like @Preview(showBackground = true, backgroundColor = 0xFFF4F9FF). Would be great if Showkase read that and added that to the metadata (and of course that could be used when rendering the default showkase gallery).

@ShowkaseComposable(name = "Basic card", group = "Cards")
@Preview(showBackground = true, backgroundColor = 0xFFF4F9FF)
@Composable
fun MyCardPreview() {
    MyTheme {
        MyCard {
            Text(text = "Capybaras are the best!")
        }
    }
}

That's probably not too hard to do, let me know if you would like a PR for that.

vinaygaba commented 1 year ago

Duplicates #289