val myClass = CssClassDecl("myClass")
val myCss1: CssDecl = css"""
/* Any valid CSS */
.$myClass {
...
}
"""
val myCss2 = CssDecl("css-file-from-resources.css", myClass)
...
body(
myCss1, myCss2, // actually in any place in virtual DOM
div(
myClass
)
)
Pros:
- Korolev knows more about symantics of the app.
- More opportunities for creating redistributable components.
- Dynamic CSS. Allows to add comples rules ad-hoc.
Cons:
- You need to decalre classes outside of body of CSS. It's in spirit of Korolev (like
ElementId
), but mind-blowing for common programmer. - Dynamic CSS. Allows to add comples rules ad-hoc. May be bad for runtime performance.
- Dynamic CSS. Lack of global optimization.
- No syntax highlighting in IDE in
myCss1
case.