Skip to content

Load font assets dynamically in the editor's iframe when the global settings are modified #51764

Closed
@matiasbenedetto

Description

Description

If you update the theme JSON data modified client side using useGlobalSettings hook in the editor's Iframe without reloading the page, the font presets are loaded on the editor's iframe correctly, but the assets linked in the font presets are not. If I reload the page, the assets added client side are loaded as expected. /

I think the font assets should be automatically loaded if you update the settings.

Step-by-step reproduction instructions

  1. add font families to typography.fontFamilies global settings using the useGlobalSettings hook.
  2. Observe that the new font families assets are not loaded in the editor iframe.
  3. Reload the page and observe that now the font assets are loaded in the iframe.

Screenshots, screen recording, code snippet

No response

Environment info

  • Gutenberg trunk
  • WordPress 6.2

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Assignees

No one assigned

    Labels

    Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Feature] Site EditorRelated to the overarching Site Editor (formerly "full site editing")[Feature] TypographyFont and typography-related issues and PRs[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions