diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Alert.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Alert.kt index 2d13141..42898c5 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Alert.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Alert.kt @@ -37,8 +37,9 @@ fun AlertCloseButton( A( null, { - include(UIKitAlert.Close) + include(UIKitAlert.Close, UIKitIcon) attr("uk-close", "") + classes("uk-close") attrs.builder(this) }, content diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Icon.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Icon.kt index e9e528e..ab923af 100644 --- a/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Icon.kt +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/elements/Icon.kt @@ -211,8 +211,7 @@ sealed class Icon(val name: String) { onClick: ((Event) -> Unit)? = null ) { val configurer: AttrBuilderContext = { - classes("uk-icon") - include(*modifiers, type) + include(*modifiers, type, UIKitIcon) attr("uk-icon", "icon: $name${if (ratio != null) { "; ratio: $ratio" } else ""}") onClick ?.let { _ -> onClick { onClick(it.nativeEvent) } diff --git a/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitIcon.kt b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitIcon.kt new file mode 100644 index 0000000..d951ad9 --- /dev/null +++ b/src/jsMain/kotlin/dev/inmo/jsuikit/modifiers/UIKitIcon.kt @@ -0,0 +1,7 @@ +package dev.inmo.jsuikit.modifiers + +sealed class UIKitIcon(classname: String) : UIKitModifier { + override val classes: Array = arrayOf(classname) + + companion object : UIKitIcon("uk-icon") +}