tomusborne / generatepress

452 stars 89 forks source link

Add support for font fallbacks for custom fonts #580

Closed simkoG closed 1 year ago

simkoG commented 1 year ago

Description

GeneratePress offers the fantastic capability to utilize custom fonts on our websites. However, there is a significant limitation in that we are unable to specify fallback fonts for these custom typefaces.

Presently, when a custom font is applied to the body tag, the generated CSS code appears as follows:

body, button, input, select, textarea {
      font-family: Gabarito;
}

The correct way to specify custom fonts for a website should be:

body, button, input, select, textarea {
      font-family: Gabarito, sans-serif;
}

It would greatly benefit the user experience to have an option within the Font Manager section where we can designate fallback fonts for custom typefaces.

image


References

diggeddy commented 1 year ago

This is already possible.

The font family name field accepts any value you can add to a font-family property including a font stack. For example:Gabarito, sans-serif or Gabarito, system-ui, sans-serif

You could also do this with Google Fonts, by fist adding a google font, and then adding a font stack.

Screenshot 2023-10-24 at 12 52 14