: Performance hit of a lot of unused font-faces If you have an html file, and in that html file you link to styles.css which covers all the styling of the page. Then inside of styles.css
If you have an html file, and in that html file you link to styles.css which covers all the styling of the page. Then inside of styles.css you have something like @import url('../css/fonts.css'). Fonts.css is just a couple dozen font-face declarations. Basically covering all of your bases.
If styles.css only uses one or two of those fonts, will there be a performance hit when the browser tries to download all of the unused fonts in fonts.css, or will it only download the ones it needs as it comes up?
Similarly, what happens if fonts.css was linked inside of the HTML file?
More posts by @Pierce454
1 Comments
Sorted by latest first Latest Oldest Best
@import in-and-of itself is slow. You shouldn't be using unless absolutely necessary and in this case I don't think it is. Just create a second <link> element to the style sheet with the font rules or include them in styles.css.
Unused font that needs to be downloaded will not be downloaded so declaring them but never using them will not hurt performance.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.