From dc3b743f2c9068926c3548f3184c74c548f46162 Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Thu, 15 Jul 2021 23:36:48 +0200 Subject: [PATCH] [web] Color is a namespace, use CSSColorValue whenever you need StylePropertyValue subtype --- .../src/jsMain/kotlin/com/sample/style/Stylesheet.kt | 4 ++-- .../src/jsMain/kotlin/org/jetbrains/compose/web/css/Color.kt | 2 +- .../src/jsMain/kotlin/androidx/compose/web/sample/Sample.kt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/benchmark-core/src/jsMain/kotlin/com/sample/style/Stylesheet.kt b/web/benchmark-core/src/jsMain/kotlin/com/sample/style/Stylesheet.kt index 538724a015..4c664cbaae 100644 --- a/web/benchmark-core/src/jsMain/kotlin/com/sample/style/Stylesheet.kt +++ b/web/benchmark-core/src/jsMain/kotlin/com/sample/style/Stylesheet.kt @@ -4,8 +4,8 @@ import org.jetbrains.compose.web.css.* import org.jetbrains.compose.web.css.selectors.CSSSelector object AppCSSVariables : CSSVariables { - val wtColorGreyLight by variable() - val wtColorGreyDark by variable() + val wtColorGreyLight by variable() + val wtColorGreyDark by variable() val wtOffsetTopUnit by variable() val wtHorizontalLayoutGutter by variable() diff --git a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/Color.kt b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/Color.kt index 8495c4d9d9..224e007048 100644 --- a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/Color.kt +++ b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/Color.kt @@ -4,7 +4,7 @@ package org.jetbrains.compose.web.css external interface CSSColorValue: StylePropertyValue, CSSVariableValueAs -abstract class Color : CSSStyleValue, CSSColorValue { +object Color { data class Named(val value: String) : CSSColorValue { override fun toString(): String = value } diff --git a/web/integration-core/src/jsMain/kotlin/androidx/compose/web/sample/Sample.kt b/web/integration-core/src/jsMain/kotlin/androidx/compose/web/sample/Sample.kt index 1fa082c90c..70ffd80cf8 100644 --- a/web/integration-core/src/jsMain/kotlin/androidx/compose/web/sample/Sample.kt +++ b/web/integration-core/src/jsMain/kotlin/androidx/compose/web/sample/Sample.kt @@ -39,7 +39,7 @@ val globalState = State() val globalInt = mutableStateOf(1) object MyCSSVariables : CSSVariables { - val myVar by variable() + val myVar by variable() val myVar2 by variable() }