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 # Optional theming theme: default # 'default' or one of the theme available in 'src/assets/themes'. +# Optional custom stylesheet +# 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. # 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 { this.config = merge(defaults, config); this.services = this.config.services; document.title = `${this.config.title} | ${this.config.subtitle}`; + if (this.config.stylesheet) { + let stylesheet = ''; + for (const file of this.config.stylesheet) { + stylesheet += `@import "${file}";`; + } + this.createStylesheet(stylesheet); + } }, methods: { getConfig: function (path = "assets/config.yml") { @@ -235,6 +242,11 @@ export default { }, }; }, + createStylesheet: function(css) { + let style = document.createElement('style'); + style.appendChild(document.createTextNode(css)); + document.head.appendChild(style); + }, }, };