https://kotlinlang.org logo
#compose-web
Title
# compose-web
a

Ayfri

08/15/2022, 7:11 PM
Hi, I can't set a value for a CSS variable in an inline script ? I have this
Copy code
object FooterStyle : StyleSheet() {
    val buttonColor by variable<CSSColorValue>()

    val button by style {
        backgroundColor(buttonColor.value())
        ...
    }
}

// somewhere in a @Composable
A(href = "/my-route", {
    target(ATarget.blank)
    classes(FooterStyle.button)

    style {
        FooterStye.buttonColor(Color.gray)
    }
}) {
    Text("Download")
}
But the variable isn't set in my resulting CSS and there's even no inline style at all 🤔
4 Views