DEV Community

Discussion on: How to load a google font in a web component ?

Collapse
 
aminnairi profile image
Amin

Very good question. I never really managed to do it in an encapsulated way. I always ended up adding the link tag in both my component and the client's code (where the component is used). But that totally kills the portability of the component. I'm writing this comment to get a followup on this one.

If you manage to find a way on your own, don't forget to share it with us!

Collapse
 
rocktimsaikia profile image
Rocktim Saikia

sure. I am reading every single web component article on mdn to find something related to this issue. Currently injecting the link to the client side is the only option I see.