aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/KVManager.kt12
-rw-r--r--src/main/resources/css/paper.css12
2 files changed, 23 insertions, 1 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/KVManager.kt b/src/main/kotlin/pl/treksoft/kvision/KVManager.kt
index 0030cf9d..e1c169c0 100644
--- a/src/main/kotlin/pl/treksoft/kvision/KVManager.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/KVManager.kt
@@ -29,6 +29,7 @@ import com.github.snabbdom.datasetModule
import com.github.snabbdom.eventListenersModule
import com.github.snabbdom.propsModule
import com.github.snabbdom.styleModule
+import org.w3c.dom.asList
import pl.treksoft.kvision.core.Component
import pl.treksoft.kvision.utils.isIE11
import kotlin.browser.document
@@ -48,8 +49,17 @@ internal object KVManager {
internal const val AJAX_REQUEST_DELAY = 300
internal const val KVNULL = "#kvnull"
+ private val links = document.getElementsByTagName("link")
private val bootstrapWebpack = try {
- require("bootstrap-webpack")
+ val bootswatch = links.asList().find { it.getAttribute("href")?.contains("bootstrap.min.css") ?: false }
+ if (bootswatch != null) {
+ if (bootswatch.getAttribute("href")?.contains("/paper/") ?: false) {
+ require("./css/paper.css")
+ }
+ require("bootstrap-webpack!./js/bootstrap.config.js")
+ } else {
+ require("bootstrap-webpack")
+ }
} catch (e: Throwable) {
}
private val fontAwesomeWebpack = try {
diff --git a/src/main/resources/css/paper.css b/src/main/resources/css/paper.css
new file mode 100644
index 00000000..6e923117
--- /dev/null
+++ b/src/main/resources/css/paper.css
@@ -0,0 +1,12 @@
+body {
+ font-size: 14px;
+ line-height: 1.42857143;
+}
+
+.kv-radio-checkbox {
+ padding-left: 20px !important;
+}
+
+.radio label, .checkbox label {
+ white-space: nowrap;
+}