From 80e227d6279a9cf7e34ecce1d11291a1c6c12f57 Mon Sep 17 00:00:00 2001 From: Shagen Ogandzhanian Date: Tue, 20 Jul 2021 10:15:53 +0200 Subject: [PATCH] backgroundColor accepts only color signature --- .../org/jetbrains/compose/web/css/properties/background.kt | 4 ---- web/core/src/jsTest/kotlin/CSSStylesheetTests.kt | 4 ++-- web/core/src/jsTest/kotlin/css/CSSBackgroundTests.kt | 4 ++-- web/core/src/jsTest/kotlin/elements/AttributesTests.kt | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/properties/background.kt b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/properties/background.kt index d47bdc024e..5e1285e335 100644 --- a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/properties/background.kt +++ b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/properties/background.kt @@ -14,10 +14,6 @@ fun StyleBuilder.backgroundClip(value: String) { property("background-clip", value) } -fun StyleBuilder.backgroundColor(value: String) { - property("background-color", value) -} - fun StyleBuilder.backgroundColor(value: CSSColorValue) { property("background-color", value) } diff --git a/web/core/src/jsTest/kotlin/CSSStylesheetTests.kt b/web/core/src/jsTest/kotlin/CSSStylesheetTests.kt index 07b769e309..8a5c3d8375 100644 --- a/web/core/src/jsTest/kotlin/CSSStylesheetTests.kt +++ b/web/core/src/jsTest/kotlin/CSSStylesheetTests.kt @@ -52,7 +52,7 @@ object AppStylesheet : StyleSheet() { val withMedia by style { color("lime") - backgroundColor("lime") + backgroundColor(Color.lime) media(mediaMinWidth(20000.px)) { self style { @@ -62,7 +62,7 @@ object AppStylesheet : StyleSheet() { media(mediaMinWidth(20.px)) { self style { - backgroundColor("green") + backgroundColor(Color.green) } } diff --git a/web/core/src/jsTest/kotlin/css/CSSBackgroundTests.kt b/web/core/src/jsTest/kotlin/css/CSSBackgroundTests.kt index 00c351f7e2..3d3dc03eb6 100644 --- a/web/core/src/jsTest/kotlin/css/CSSBackgroundTests.kt +++ b/web/core/src/jsTest/kotlin/css/CSSBackgroundTests.kt @@ -19,10 +19,10 @@ class CSSBackgroundTests { fun backgroundColor() = runTest { composition { Div({style { - backgroundColor("rgb(0, 128, 0)") + backgroundColor(rgb(0, 128, 0)) }}) Div({style { - backgroundColor("rgba(0, 129, 0, 0.2)") + backgroundColor(rgba(0, 129, 0, 0.2)) }}) } diff --git a/web/core/src/jsTest/kotlin/elements/AttributesTests.kt b/web/core/src/jsTest/kotlin/elements/AttributesTests.kt index 1a7bab93e4..a02bbce76d 100644 --- a/web/core/src/jsTest/kotlin/elements/AttributesTests.kt +++ b/web/core/src/jsTest/kotlin/elements/AttributesTests.kt @@ -48,7 +48,7 @@ class AttributesTests { ref { onDispose { } } style { width(500.px) - backgroundColor("red") + backgroundColor(Color.red) } onClick { }