Inline CSS & Google Fonts
-
I noticed that when you’re using a particularly button heavy page the CSS is all inlined which is fine but this generates quite a few issues from a performance perspective and while I could aggregate all the CSS into a file, there are over 20 buttons and the google font’s are loaded via @import.
This raises a couple of performance issues with this primarily, the following.
1. Because the google fonts are loaded via @import they can’t be aggregated whether it is via a plugin like Autoptimize, WPRocket, or Google WebFont Optimizer. So on a page where there are 9 different buttons, this can really begin to hinder performance as all the files are loaded with @import.
2. Additionally, because the CSS is inlined it can’t be cached unless the users take all the CSS and load it into its own file.
Suggestions.
Would it be possible in the future for the CSS files that are selected for the buttons be enqueued like a normal font file would be, & if possible could the inline CSS be run through a compiler so it is aggregated into a single file.
- The topic ‘Inline CSS & Google Fonts’ is closed to new replies.