Where to import font families
When we decided which google font we want, we need to add it to our code. My students use @import
in css/scss and <link />
in HTML, sometimes both at the same time.
1 | <!-- index.html --> |
If we choose to use <link />
, there is no need to use @import
as well. That would mean that we are importing that font family twice.
The thing about the @import
directive, is that it waits for all the fonts to be loaded and only then will it load the rest of the content. Read this stack overflow answer to find more about it. The <link />
should be used because it is faster than @import
.
1 | <!-- index.html --> |