From bb4e97b149eb20ca8edae5b8fff6b144d858c1aa Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Fri, 16 Jul 2021 23:07:35 +0200 Subject: [PATCH] CSSVariableValueAs is not a StylePropertyValue --- .../kotlin/org/jetbrains/compose/web/css/StyleBuilder.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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,