dvdandroid
02/20/2022, 4:31 PMorg.jetbrains.compose.web.css.StyleScope
?
ex:
Span({
style { // this is org.jetbrains.compose.web.css.StyleScope, not org.jetbrains.compose.web.css.CSSBuilder
property("color", "#fff") // <-- hover??
}
})
compose 1.1.0-alpha05
Oleksandr Karpovich [JB]
02/21/2022, 9:26 AMdvdandroid
02/21/2022, 1:56 PMorg.jetbrains.compose.web.css.CSSBuilder
interface instead of org.jetbrains.compose.web.css.StyleScope
the one you are suggesting: https://github.com/JetBrains/compose-jb/blob/master/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/StyleSheet.kt#L48
org.jetbrains.compose.web.css.CSSBuilder
(so hover etc..)David Herman
02/23/2022, 5:34 AMDavid Herman
02/23/2022, 5:34 AMDavid Herman
02/23/2022, 5:35 AMDavid Herman
02/23/2022, 5:36 AM<span style="color:#fff" />
☝️ The style is defined "inline", e.g. inside the tag, vs. say <span class="external-style" />
where the style info is now detached and associated with that class name and can be defined elsewhere (often a style sheet).David Herman
02/23/2022, 5:37 AMDavid Herman
02/23/2022, 5:43 AMval MyHoverableSpanStyle = ComponentStyle("hoverable-span") {
base { Modifier.color(Colors.White) }
hover { Modifier.backgroundColor(Colors.Yellow) }
}
Span(MyHoverableSpanStyle.toModifier().asAttributesBuilder()) { ... }
David Herman
02/23/2022, 5:44 AM