diff --git a/src/components/style/style.ts b/src/components/style/style.ts index a4420f6b9..b0790ca96 100644 --- a/src/components/style/style.ts +++ b/src/components/style/style.ts @@ -38,10 +38,12 @@ export class CoreStyleComponent implements OnChanges { * Component being changed. */ ngOnChanges(changes: { [name: string]: SimpleChange }): void { - const css = this.prefixCSS(this.css, this.prefix); - if (this.element && this.element.nativeElement) { - this.element.nativeElement.innerHTML = ''; + const style = document.createElement('style'); + style.innerText = this.prefixCSS(this.css, this.prefix); + + this.element.nativeElement.innerHTML = ''; + this.element.nativeElement.appendChild(style); } }