diff options
author | Gabe Cook <gabe565@gmail.com> | 2020-07-22 15:42:43 -0500 |
---|---|---|
committer | Gabe Cook <gabe565@gmail.com> | 2020-08-29 02:21:09 -0500 |
commit | 6777bc347bd7992a5797b02d0a0bc0c7e43df46e (patch) | |
tree | 78049cc121baa69fef458f9fa7e910dcb016fd19 /src/App.vue | |
parent | 264410127684dd006bb5fab6b58d39141f9b3661 (diff) | |
download | homer-6777bc347bd7992a5797b02d0a0bc0c7e43df46e.tar.gz homer-6777bc347bd7992a5797b02d0a0bc0c7e43df46e.tar.zst homer-6777bc347bd7992a5797b02d0a0bc0c7e43df46e.zip |
:sparkles: Add support for a custom stylesheet
Diffstat (limited to 'src/App.vue')
-rw-r--r-- | src/App.vue | 8 |
1 files changed, 8 insertions, 0 deletions
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 { | |||
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 | this.createStylesheet(`@import "${this.config.stylesheet}";`); | ||
165 | } | ||
163 | }, | 166 | }, |
164 | methods: { | 167 | methods: { |
165 | getConfig: function (path = "assets/config.yml") { | 168 | getConfig: function (path = "assets/config.yml") { |
@@ -235,6 +238,11 @@ export default { | |||
235 | }, | 238 | }, |
236 | }; | 239 | }; |
237 | }, | 240 | }, |
241 | createStylesheet: function(css) { | ||
242 | let style = document.createElement('style'); | ||
243 | style.appendChild(document.createTextNode(css)); | ||
244 | document.head.appendChild(style); | ||
245 | }, | ||
238 | }, | 246 | }, |
239 | }; | 247 | }; |
240 | </script> | 248 | </script> |