How to prevent unused fonts from being loaded?

:wave: Is there any way to get rid of those?

I have to mention that I’m testing this out on a single page site, which doesn’t use that font at all. (or I cannot find it used anywhere)

Hi @impressive_cardinal, you can specify the skipFonts setting to PlasmicRootProvider

in the UI, or in the plasmic.json file? :thinking_face:

i think i found it:
https://docs.plasmic.app/learn/react-api/#plasmicrootprovider-

something is off, typescript doesn’t know any such attribute for <PlasmicRootProvider> and even if I ignore the typescript warning, the fonts are still loaded in the local version :thinking_face:

oh, also there are 2 versions in the documentation:

  1. skipFont (singular): https://docs.plasmic.app/learn/page-performance/#font-optimization
  2. skipFonts (plural): https://docs.plasmic.app/learn/react-api/#plasmicrootprovider-

If you have a plasmic.json…are you using codegen?

yes

There’s still something in your project that is actively using the requested font… It may be one of the default text styles. You can search the full raw project representation: https://docs.plasmic.app/learn/model-quickstart/

I got this, but I already changed the default styles :thinking_face:

I think is relevant to know that I added a custom font.

“Outfit” is a custom font.

I still see it set:

hm… but doesn’t “All text” option update all of them? :thinking_face:

We should probably rename that to “Default text”! The other more specific settings override “All text”, so just because “All text” says font size is 16px, your headings can still be 48px for instance

Yep, now it makes sense. :sweat_smile:

If I want to set up fallback fonts, do I have to update these settings in the generated CSS file? Or is possible to set it from the UI?

It’s not yet possible to do from the UI, so you’ll need to do this from CSS for now

Ok, thank you! :pray:

I’m surprised finding somebody during this period (+ somebody to respond so fast). :grin: :raised_hands: