-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fonts API] All registered fonts are being rendered outside of the Site Editor #49645
Comments
Reopening as #49646 was reverted for now, i.e. until other dependencies are committed. |
I've marked this issue as blocked. It's currently blocked by #40363. Why? See this explanation: #49646 (comment)
|
A fix is ready for merging. However, IMO the bugfix should wait until #40362 is resolved. I explain the reasoning here. |
Update: This issue is no longer valid for the Fonts API once the Font Library is merged. Why? As shared in Ongoing Roadmap update #41479 (comment), the Fonts API will no longer be expose "register" or "enqueue" functionality. Instead, it will pull the fonts from theme.json merged data. I'll close this issue. |
Description
In
lib/compat/wordpress-6.2/gutenberg_resolve_assets_override()
, all of the registered fonts are being rendered when not in the Site Editor. This can cause a performance issue when a plugin(s) registers additional fonts for user selection.The way it's supposed to work is this:
Step-by-step reproduction instructions
Inspector
tab.wp-fonts-jetpack-google-fonts
.The expected behavior:
<style id="wp-fonts-jetpack-google-fonts">
should not exist.<style id="wp-fonts-local">
should exist (these are the theme's defined fonts).Screenshots, screen recording, code snippet
With no user selected fonts,
<style id="wp-fonts-jetpack-google-fonts">
should not exist in a Post's iframed editor HTML.Notice in the following screenshot, it does exist in the Post's iframed editor HTML 🐞 ❌
Environment info
trunk
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
The text was updated successfully, but these errors were encountered: