I'm using Kotlin to Javascript plugin and kotlinx.html library to build sample app:
fun main(args: Array<String>) {
window.onload = {
document.body!!.append.div {
a("#", classes = "red") {
+"Link"
}
}
}
}
And I want to paint a
link with "red" CSS class to red color.
Now I'm using unsage
+ raw
to do it:
document.head!!.append.style {
unsafe {
raw(".red { background: #f00; }")
}
}
How to create CSS class with kotlinx.html DSL? I didn't find any docs related to css DSL.