FortAwesome / angular-fontawesome

Official Angular component for Font Awesome 5+
https://fontawesome.com
MIT License
1.49k stars 152 forks source link

size not work in lazy load modules #274

Closed nhaancs closed 4 years ago

nhaancs commented 4 years ago

The size property of work when I tried in app component, but when I try it in a component belong to a lazy load module, it doesn't work.

Notes:

devoto13 commented 4 years ago

Seems to work fine: https://stackblitz.com/edit/angular-z8v4ux-vv3m9g?file=src%2Fapp%2Flazy.ts

Most likely the issue is in your code, but if you still believe that this is a bug, please provide a minimal reproduction, so we can reproduce and investigate it.

nhaancs commented 4 years ago

@devoto13 thanks for your hint. I checked my code, the reason is I set encapsulation: ViewEncapsulation.ShadowDom in the component. Is that intended?

Demo: https://stackblitz.com/edit/angular-z8v4ux-xb6tn5?file=src/app/lazy.ts

devoto13 commented 4 years ago

Yeah, angular-fontawesome injects its styles with arbitrary JS and therefore it is not compatible with ShadowDom. Please subscribe to https://github.com/FortAwesome/angular-fontawesome/issues/96 to track updates in this area.

nhaancs commented 4 years ago

Thank you 👍