diff --git a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/CSSProperties.kt b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/CSSProperties.kt index 56926b2753..8debb29aa0 100644 --- a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/CSSProperties.kt +++ b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/CSSProperties.kt @@ -63,22 +63,6 @@ inline fun CSSBorder.color(color: CSSColorValue) { this.color = color } -inline fun StyleBuilder.border(crossinline borderBuild: CSSBorder.() -> Unit) { - property("border", CSSBorder().apply(borderBuild)) -} - -fun StyleBuilder.border( - width: CSSLengthValue? = null, - style: LineStyle? = null, - color: CSSColorValue? = null -) { - border { - width?.let { width(it) } - style?.let { style(it) } - color?.let { color(it) } - } -} - fun StyleBuilder.display(displayStyle: DisplayStyle) { property("display", displayStyle.value) } @@ -132,34 +116,6 @@ fun StyleBuilder.position(position: Position) { ) } -fun StyleBuilder.borderRadius(r: CSSNumeric) { - property("border-radius", r) -} - -fun StyleBuilder.borderRadius(topLeft: CSSNumeric, bottomRight: CSSNumeric) { - property("border-radius", "$topLeft $bottomRight") -} - -fun StyleBuilder.borderRadius( - topLeft: CSSNumeric, - topRightAndBottomLeft: CSSNumeric, - bottomRight: CSSNumeric -) { - property("border-radius", "$topLeft $topRightAndBottomLeft $bottomRight") -} - -fun StyleBuilder.borderRadius( - topLeft: CSSNumeric, - topRight: CSSNumeric, - bottomRight: CSSNumeric, - bottomLeft: CSSNumeric -) { - property( - "border-radius", - "$topLeft $topRight $bottomRight $bottomLeft" - ) -} - fun StyleBuilder.width(value: CSSNumeric) { property("width", value) } diff --git a/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/properties/border.kt b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/properties/border.kt new file mode 100644 index 0000000000..0d4f959415 --- /dev/null +++ b/web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/properties/border.kt @@ -0,0 +1,51 @@ +/* + * Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers. + * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file. + */ + +package org.jetbrains.compose.web.css + +inline fun StyleBuilder.border(crossinline borderBuild: CSSBorder.() -> Unit) { + property("border", CSSBorder().apply(borderBuild)) +} + +fun StyleBuilder.border( + width: CSSLengthValue? = null, + style: LineStyle? = null, + color: CSSColorValue? = null +) { + border { + width?.let { width(it) } + style?.let { style(it) } + color?.let { color(it) } + } +} + +fun StyleBuilder.borderRadius(r: CSSNumeric) { + property("border-radius", r) +} + +fun StyleBuilder.borderRadius(topLeft: CSSNumeric, bottomRight: CSSNumeric) { + property("border-radius", "$topLeft $bottomRight") +} + +fun StyleBuilder.borderRadius( + topLeft: CSSNumeric, + topRightAndBottomLeft: CSSNumeric, + bottomRight: CSSNumeric +) { + property("border-radius", "$topLeft $topRightAndBottomLeft $bottomRight") +} + +fun StyleBuilder.borderRadius( + topLeft: CSSNumeric, + topRight: CSSNumeric, + bottomRight: CSSNumeric, + bottomLeft: CSSNumeric +) { + property( + "border-radius", + "$topLeft $topRight $bottomRight $bottomLeft" + ) +} +