How to express the following with Compose HTML's `StyleSheet` API? ```div.mystyle { color: alicebl...
n
How to express the following with Compose HTML's
StyleSheet
API?
Copy code
div.mystyle {
  color: aliceblue;
}
Thanks.
d
If you were using Kobweb (I believe I saw your name pop up in the Kobweb community) you'd do something like what I'm doing in my blog site inside an InitSilk block: https://github.com/bitspittle/bitspittle.dev/blob/7ec7a4a9e89ee2b41974b0843a90688b[…]0a9605c/site/src/jsMain/kotlin/dev/bitspittle/site/AppStyles.kt
👍🏻 1
n
Yes, I use your foundation and "ext" libraries 🙂 Thanks for the links!
👍 1
For reference:
Copy code
object MyStyleSheet : StyleSheet() {

    val mystyle by style {}

    init {
        (type("div") + className(mystyle)) style {
            color(Color.aliceblue)
        }
    }
}
This works as well and looks even better 🙂:
Copy code
object MyStyleSheet : StyleSheet() {

    val mystyle by style {
        (type("div") + self) style {
            color(Color.aliceblue)
        }
    }
}
👍 1
1