Why do WordPress default themes specify fonts in so many places?

There’s not a universal standard for this. The precedents that the core Themes are setting are incidental to rebuilding and innovating. They are not by design.

They define font families for the Editor in the back end to establish a consistent feeling for content.

Source: https://github.com/WordPress/twentysixteen/blob/master/css/editor-style.css

Within the actual main styling of the Theme, there are 37 font family definitions.

They implement Normalize, font icons, then they begin setting baseline font families for edge case content. This happens at the beginning of their typography section.

Edge case styling is important because plugins and user modifications may bring content outside of the expected scope you were styling within, and thus causing inconsistent styling. By setting defaults outside of the normal scopes you can ensure a baseline of consistency.

Some font family specifications are there because of browser hinderances.
Like here: https://github.com/WordPress/twentysixteen/blob/master/style.css#L547

Those specific rules won’t be cross browser compatible unless they are overly verbose.

That’s done in many areas.

In addition to all of the above, the core Theme developer still has to combat default WordPress core styling. Themes have a requirement around using certain classes and supporting certain class styling, so they need to add styling for that stuff as well.

At the end of the day, they through it where they thought they needed it, and some of it might be extraneous and that’s entirely acceptable.

Leave a Comment