How to express the following with Compose HTML's `...
# compose-web
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