diff --git a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/StyleBuilder.kt b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/StyleBuilder.kt index b781fdd4ec..8a7d1a4512 100644 --- a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/StyleBuilder.kt +++ b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/StyleBuilder.kt @@ -34,7 +34,7 @@ interface StyleBuilder { inline fun variableValue(variableName: String, fallback: StylePropertyValue? = null) = "var(--$variableName${fallback?.let { ", $it" } ?: ""})" -external interface CSSVariableValueAs: StylePropertyValue +external interface CSSVariableValueAs inline fun CSSVariableValue(value: StylePropertyValue) = value.unsafeCast() @@ -68,7 +68,10 @@ fun CSSStyleVariable.value(fallback: TValue ) ) -fun > CSSStyleVariable.value(fallback: TValue? = null) = +fun CSSStyleVariable.value(fallback: TValue? = null) + where TValue : CSSVariableValueAs, + TValue: StylePropertyValue + = CSSVariableValue( variableValue( name,