aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBastien Wirtz <bastien.wirtz@gmail.com>2020-08-29 10:50:42 -0700
committerGitHub <noreply@github.com>2020-08-29 10:50:42 -0700
commit83665e4f48e8db29d74a2e84b8befb6076c08665 (patch)
tree7fe075749353683e966a87c0db4ba24294ff1f8d
parent264410127684dd006bb5fab6b58d39141f9b3661 (diff)
parent8e5ee54a7896ac8db720093f30cab8e7a0fddda1 (diff)
downloadhomer-83665e4f48e8db29d74a2e84b8befb6076c08665.tar.gz
homer-83665e4f48e8db29d74a2e84b8befb6076c08665.tar.zst
homer-83665e4f48e8db29d74a2e84b8befb6076c08665.zip
Merge pull request #113 from gabe565/custom-stylesheet
Add support for a custom stylesheet
-rw-r--r--docs/configuration.md5
-rw-r--r--src/App.vue12
2 files changed, 17 insertions, 0 deletions
diff --git a/docs/configuration.md b/docs/configuration.md
index 1ced2d8..edcf1ed 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -26,6 +26,11 @@ connectivityCheck: true # whether you want to display a message when the apps ar
26# Optional theming 26# Optional theming
27theme: default # 'default' or one of the theme available in 'src/assets/themes'. 27theme: default # 'default' or one of the theme available in 'src/assets/themes'.
28 28
29# Optional custom stylesheet
30# Will load custom CSS files. Especially useful for custom icon sets.
31# stylesheet:
32# - "assets/custom.css"
33
29# Here is the exaustive list of customization parameters 34# Here is the exaustive list of customization parameters
30# However all value are optional and will fallback to default if not set. 35# However all value are optional and will fallback to default if not set.
31# if you want to change only some of the colors, feel free to remove all unused key. 36# if you want to change only some of the colors, feel free to remove all unused key.
diff --git a/src/App.vue b/src/App.vue
index 5f52c8f..03760fd 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -160,6 +160,13 @@ export default {
160 this.config = merge(defaults, config); 160 this.config = merge(defaults, config);
161 this.services = this.config.services; 161 this.services = this.config.services;
162 document.title = `${this.config.title} | ${this.config.subtitle}`; 162 document.title = `${this.config.title} | ${this.config.subtitle}`;
163 if (this.config.stylesheet) {
164 let stylesheet = '';
165 for (const file of this.config.stylesheet) {
166 stylesheet += `@import "${file}";`;
167 }
168 this.createStylesheet(stylesheet);
169 }
163 }, 170 },
164 methods: { 171 methods: {
165 getConfig: function (path = "assets/config.yml") { 172 getConfig: function (path = "assets/config.yml") {
@@ -235,6 +242,11 @@ export default {
235 }, 242 },
236 }; 243 };
237 }, 244 },
245 createStylesheet: function(css) {
246 let style = document.createElement('style');
247 style.appendChild(document.createTextNode(css));
248 document.head.appendChild(style);
249 },
238 }, 250 },
239}; 251};
240</script> 252</script>