diff options
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/utils')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/utils/Utils.kt | 13 |
1 files changed, 9 insertions, 4 deletions
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 @@ -148,13 +148,18 @@ 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 } } |