How WordPress default themes add Google Fonts

I spent some time diving into Twenty Seventeen in preparation to develop for the theme directory. I was curious as to how the developers of very popular theme would enqueue a Google Font. I am no stranger to using a @import tag in the stylesheet, but I assumed there had to be a more sustainable solution. What I found was a thoughtful way of adding a font which I have digested into a gist below.

Handling your Google Fonts in this manner allows translators of your theme to disregard a font that may hinder the translation.

If you are in a similar position as I am, trying to sharpen your WordPress skillset, I highly recommend tearing into some of the default themes. They are a plethora of knowledge.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.