- // We test customCSS in case or the admin removed the css
- if (this.customCSS || config.instance.customizations.css) {
- const styleTag = '<style>' + config.instance.customizations.css + '</style>'
- this.customCSS = this.domSanitizer.bypassSecurityTrustHtml(styleTag)
- }
+ // Inject CSS if modified (admin config settings)
+ this.serverService.configLoaded
+ .pipe(skip(1)) // We only want to subscribe to reloads, because the CSS is already injected by the server
+ .subscribe(() => {
+ const headStyle = document.querySelector('style.custom-css-style')
+ if (headStyle) headStyle.parentNode.removeChild(headStyle)
+
+ const config = this.serverService.getConfig()