Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 7 + ShadowDOM - Loading strategies for @angular/material skins

I'm wanting to do an Angular 7 application with all of the encapsulation set to ViewEncapsulation.ShadowDom - and that's all well and good.

But I cannot seem to find any sort of reliable reference that shows a good way to approach this with regards to skinning things like @angular/material. Since global styles are worthless, I cannot just follow the rules at Theming Angular Material because they ...well, don't work.

Has anyone managed to get this working in a decent fashion?

like image 246
Ciel Avatar asked Oct 17 '22 08:10

Ciel


1 Answers

I was running into similar issue. However, at the angular element component where I was using ViewEncapsulation.ShadowDOM - I had to import the theme.scss that I was using in angular.json @import "~@angular/material/prebuilt-themes/deeppurple-amber.css"; in the components scss file.

And, things worked.

like image 200
Anirudh Reddy Kontham Avatar answered Oct 20 '22 05:10

Anirudh Reddy Kontham