pixelgrade / customify

Intuitive Website Styling integrated into WordPress' Customizer
GNU General Public License v2.0
28 stars 5 forks source link

[Fonts] Load only selected font weight #226

Closed madalingorbanescu closed 4 years ago

madalingorbanescu commented 4 years ago

While testing fonts in Rosa2, I saw that currently, we are loading all font weights. For example, if I using Roboto with a font-weight of 400 on the body, Customify will make a request for all the font variants.

Video: https://share.getcloudapp.com/Jru6RmW6

Let me know what do you think about that @vladolaru

vladolaru commented 4 years ago

Just for history's sake, we always request from the Google Fonts API a stylesheet with the definitions of all the font-faces available for a certain font and we rely on the browser to determine what font-faces should actually be loaded. This is the most flexible and efficient way to load fonts nowadays.