Request: font-display for Google fonts

Had this posted in here earlier but it got wiped out. Google supports font-display with an added query param. I would love to see that as on option in the font manager.

1 Like

@michaelbourne, I’m aware of font-display but have never used it personally on a project. It seems that when the font-display property is set, it then uses the stack in font-family to derive the fallbacks and how they should work, is that correct from your usage? X currently sets the font stacks very shallow. For instance, if you set “Lato” as your body font, it will output font-family: Lato, sans-serif. Would this be enough to just allow you to set font-display and use the existing font stacks we use, or would you also need/want tome way to inject another fallback font into that stack like: font-family: Lato, michaels-custom-font, sans-serif?

For Google fonts, a simple toggle is all that’s needed I think.

On custom fonts, it would totally make sense to be able to set your own font stack, or at the very least be able to choose serif/sans.

Thanks for the extra feedback! We actually had an open feature request for this already so I’ve added some notes from here. Regretfully, it’s not some thing we will likely implement for this release. It is however a goal we have for the next cycle.

In the meantime, I’ve added this filter: cs_google_fonts_href which will be in the next beta (and official release).

It will let you change the href of the Google Fonts style tag output on the front end. You could use it to add a query parameter. Unfortunately this won’t have an effect in the builders.

I live for more dev functions, you know that. You’re a beauty.

This one is just for you Michael :smiley: