Reputation: 6421
I'm trying to use custom fonts in my app. I have 2 fonts, one is a icon font from flaticons and another is the text font "Humanst webfont", i've downloaded them both and followed lots of tutorials on how to make them work, here is what i've got so far:
THE ERROR: Erro thrown of broken import
MY PROJECT FOLDERS: THE SRC AND WWW FOLDERS
And i have this in my app.scss:
@import "../assets/fonts/humanst-webfont.css";
@import "../assets/fonts/flaticon.css";
This is my humans-webfotn.css:
@font-face {
font-family: 'Humanst';
src: url('humanst-webfont.woff2') format('woff2'),
url('humanst-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
i've tryed importing the .css, the .scss and letting just humanst-webfont. Updated my appscripts to 1.0.0 too. In ionic serve it works fine, but when i try to build it breaks. Does someone know what it is?
Thanks in advance :)
Upvotes: 3
Views: 745
Reputation: 2279
I was having the same problem. I ended putting the css in the index.html instead of the variables file. Worked fine during production build and during serve.
Upvotes: 1