Is there a way to represent the following with `Cs...
# kobweb
n
Is there a way to represent the following with
CssStyle
?
Copy code
object MyStyleSheet : StyleSheet() {
    val myComponent by style {
        (type("div") + self) style {
            display(...)
        }
        (type("div") + self) child type("div") style {
            display(...)
        }
    }
}
Which results in the following CSS declaration:
Copy code
div.MyStyleSheet-myComponent {
    display: ...;
}
div.MyStyleSheet-myComponent > div {
    display: ...;
}
Thanks.
d
Copy code
val MyExampleStyle = CssStyle {
  base { ... }
  cssRule(" > div") {
     ...
  }
}
is what I would do in general You can also do
Copy code
@InitSilk
fun initSilk(ctx: InitSilkContext) {
  ctx.stylesheet.registerStyle("div.my-example") { ...
}
if including the div is really that important?
🙏 1