]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
:sparkles: Add support for a custom stylesheet
authorGabe Cook <gabe565@gmail.com>
Wed, 22 Jul 2020 20:42:43 +0000 (15:42 -0500)
committerGabe Cook <gabe565@gmail.com>
Sat, 29 Aug 2020 07:21:09 +0000 (02:21 -0500)
src/App.vue

index 5f52c8f2fd40e017937e9b8b837cebcf2bfa05f4..272b3f6770bf020777482707cca867345d98ea2d 100644 (file)
@@ -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);
+    },
   },
 };
 </script>