aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/core/Css.kt26
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt14
2 files changed, 39 insertions, 1 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/core/Css.kt b/src/main/kotlin/pl/treksoft/kvision/core/Css.kt
index 091c806a..ff01cc9f 100644
--- a/src/main/kotlin/pl/treksoft/kvision/core/Css.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/core/Css.kt
@@ -28,7 +28,7 @@ import pl.treksoft.kvision.utils.toHexString
* Definitions of CSS units.
*/
@Suppress("EnumNaming", "EnumEntryName")
-enum class Unit(internal val unit: String) {
+enum class UNIT(internal val unit: String) {
px("px"),
pt("pt"),
em("em"),
@@ -268,6 +268,30 @@ enum class Position(internal val position: String) {
}
/**
+ * Definitions of CSS overflow options.
+ */
+enum class Overflow(internal val overflow: String) {
+ VISIBLE("visible"),
+ HIDDEN("hidden"),
+ SCROLL("scroll"),
+ AUTO("auto"),
+ INITIAL("initial"),
+ INHERIT("inherit")
+}
+
+/**
+ * Definitions of CSS resize options.
+ */
+enum class Resize(internal val resize: String) {
+ NONE("none"),
+ BOTH("both"),
+ HORIZONTAL("horizontal"),
+ VERTICAL("vertical"),
+ INITIAL("initial"),
+ INHERIT("inherit")
+}
+
+/**
* Type-safe definition of CSS border.
*/
class Border private constructor(
diff --git a/src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt b/src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt
index 37eb28c7..d871ff60 100644
--- a/src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/core/StyledComponent.kt
@@ -80,6 +80,14 @@ abstract class StyledComponent : Component {
*/
var zIndex: Int? by refreshOnUpdate()
/**
+ * CSS overflow of the current component.
+ */
+ var overflow: Overflow? by refreshOnUpdate()
+ /**
+ * CSS resize of the current component.
+ */
+ var resize: Resize? by refreshOnUpdate()
+ /**
* Border of the current component.
*/
var border: Border? by refreshOnUpdate()
@@ -244,6 +252,12 @@ abstract class StyledComponent : Component {
zIndex?.let {
snstyle.add("z-index" to it.toString())
}
+ overflow?.let {
+ snstyle.add("overflow" to it.toString())
+ }
+ resize?.let {
+ snstyle.add("resize" to it.toString())
+ }
border?.let {
snstyle.add("border" to it.asString())
}