Help Regarding Google fonts in SASS

Can I Import Google fonts in a SASS module and then forward it for use in any other .scss file? In other words, how to re-export google fonts from a .scss file?
2 Replies
vince
vince11mo ago
If you're talking about @import url('https://fonts.googleapis.com/css2?family=Kalnia:wght@100&display=swap');, don't do that. It increases load times significantly. Instead download the font family (you can do this on Google fonts), convert it from ttf to woff2, and move it into something like public/fonts/ directory. Then you can declare a @font-face rule: https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face. And finally, you can make a Sass variable for your font-family declaration.
Joao
Joao11mo ago
Yes please, stop the Google fonts madness
Want results from more Discord servers?
Add your server