From b4a797930cc1a023c18f247fb0e2698ba14dad1f Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Thu, 8 Mar 2018 13:34:55 +0100 Subject: Support for text, font and position float CSS properties. --- src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt') diff --git a/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt b/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt index a25d8e06..d638f79e 100644 --- a/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt +++ b/src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt @@ -147,14 +147,19 @@ val Int.vmax: CssSize */ val auto: CssSize = Pair(0, UNIT.auto) +/** + * Helper property to describe CSS normal value. + */ +val normal: CssSize = Pair(0, UNIT.normal) + /** * Extension function to convert CssSize to String. */ fun CssSize.asString(): String { - return if (this.second != UNIT.auto) { - this.first.toString() + this.second.unit - } else { - "auto" + return when (this.second) { + UNIT.auto -> "auto" + UNIT.normal -> "normal" + else -> this.first.toString() + this.second.unit } } -- cgit