Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Font is not loading when deployed

Tags:

css

angular

I have created an angular app which loads perfectly fine in local environment. all the styles and fonts are getting applied. but when I deploy it the font is not loading. couldn't figure it out why, it didn't show any error or warning message in the console.

I'm importing all the css styles in angular.json file like below

enter image description here

demo4.css has the styles that I need. I placed the demo4 file in the first, middle and last , nothing happened and didn't made any sense !!

When running locally,

enter image description here

When deployed,

enter image description here

I was banging my head for days. What am I missing?

Update #1

This is how it looks like when I build ng build --prod

enter image description here


1 Answers

Looks like you have run into this logged issue:

The only workaround available is to Add Google fonts @import tag in the header of every SCSS used. Or import first the fonts from a different css/SCSS file

EDIT Or import your font in index.html

like image 151
nircraft Avatar answered Sep 16 '25 01:09

nircraft