beatleader-website
beatleader-website copied to clipboard
Improved importFonts() so that it doesn't try to load invalid Google font URLs
This gets rid of the errors (and unnecessary web traffic) when a theme tries to load a font that exists locally on the user's machine (that may not even exist on Google's font service). It's also smart about when a font is specified as a generic family name like sans-serif or monospace.
If a user specifies a font that they don't have locally on their system and doesn't exist in Google's font service it'll still throw an error (which is what we want; I think).