mirror of
https://github.com/taigrr/homer
synced 2025-01-18 04:53:12 -08:00
✨ Add support for a custom stylesheet
This commit is contained in:
parent
2644101276
commit
6777bc347b
@ -160,6 +160,9 @@ export default {
|
|||||||
this.config = merge(defaults, config);
|
this.config = merge(defaults, config);
|
||||||
this.services = this.config.services;
|
this.services = this.config.services;
|
||||||
document.title = `${this.config.title} | ${this.config.subtitle}`;
|
document.title = `${this.config.title} | ${this.config.subtitle}`;
|
||||||
|
if (this.config.stylesheet) {
|
||||||
|
this.createStylesheet(`@import "${this.config.stylesheet}";`);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getConfig: function (path = "assets/config.yml") {
|
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>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user