From 6777bc347bd7992a5797b02d0a0bc0c7e43df46e Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Wed, 22 Jul 2020 15:42:43 -0500 Subject: [PATCH 1/3] :sparkles: Add support for a custom stylesheet --- src/App.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/App.vue b/src/App.vue index 5f52c8f..272b3f6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -160,6 +160,9 @@ export default { this.config = merge(defaults, config); this.services = this.config.services; document.title = `${this.config.title} | ${this.config.subtitle}`; + if (this.config.stylesheet) { + this.createStylesheet(`@import "${this.config.stylesheet}";`); + } }, methods: { getConfig: function (path = "assets/config.yml") { @@ -235,6 +238,11 @@ export default { }, }; }, + createStylesheet: function(css) { + let style = document.createElement('style'); + style.appendChild(document.createTextNode(css)); + document.head.appendChild(style); + }, }, }; From 71cf63eb3bdeeced46e7eec4d62ef8cc4ca38800 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Wed, 22 Jul 2020 16:23:33 -0500 Subject: [PATCH 2/3] :pencil: Document new stylesheet config --- docs/configuration.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index 1ced2d8..f0b0a31 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -26,6 +26,10 @@ connectivityCheck: true # whether you want to display a message when the apps ar # Optional theming theme: default # 'default' or one of the theme available in 'src/assets/themes'. +# Optional custom stylesheet +# Will load a custom CSS file. Especially useful for custom icon sets. +# stylesheet: "assets/custom.css" + # Here is the exaustive list of customization parameters # However all value are optional and will fallback to default if not set. # if you want to change only some of the colors, feel free to remove all unused key. From 8e5ee54a7896ac8db720093f30cab8e7a0fddda1 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Sat, 29 Aug 2020 02:43:02 -0500 Subject: [PATCH 3/3] :wrench: Make stylesheet config be an array of files --- docs/configuration.md | 5 +++-- src/App.vue | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index f0b0a31..edcf1ed 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -27,8 +27,9 @@ connectivityCheck: true # whether you want to display a message when the apps ar theme: default # 'default' or one of the theme available in 'src/assets/themes'. # Optional custom stylesheet -# Will load a custom CSS file. Especially useful for custom icon sets. -# stylesheet: "assets/custom.css" +# Will load custom CSS files. Especially useful for custom icon sets. +# stylesheet: +# - "assets/custom.css" # Here is the exaustive list of customization parameters # However all value are optional and will fallback to default if not set. diff --git a/src/App.vue b/src/App.vue index 272b3f6..03760fd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -161,7 +161,11 @@ export default { this.services = this.config.services; document.title = `${this.config.title} | ${this.config.subtitle}`; if (this.config.stylesheet) { - this.createStylesheet(`@import "${this.config.stylesheet}";`); + let stylesheet = ''; + for (const file of this.config.stylesheet) { + stylesheet += `@import "${file}";`; + } + this.createStylesheet(stylesheet); } }, methods: {