Skip to content
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

Starter Page Templates: large iFrame preview is not rendering Google fonts #49742

Closed
andrewserong opened this issue Feb 5, 2021 · 1 comment
Assignees
Labels
[Closed] Fixed Issues explicitly fixed with PRs. Do not use for no longer reproducible issues. Page Layouts [Status] Fix Inbound Use when a fix is in unreleased component [Type] Bug

Comments

@andrewserong
Copy link
Member

andrewserong commented Feb 5, 2021

Steps to reproduce the behavior

  1. Set your site's theme to one that uses Google Fonts, e.g. Balasana or Dalston
  2. Go to add a new page
  3. Select any of the page layouts, but the ones under About show the issue clearly
  4. The text will be rendered in a system font, instead of the correct Google font

What I expected to happen

The preview to render with the theme's Google font

What actually happened

The fallback system font is used instead

Screenshots

This is how my test site looks using Balasana as the selected theme:

image

I expect it to look something like:

image

This screenshot is rendered with PR #49101 applied

Context

I can see that the <link> element that should be loading the Google fonts is being correctly added to the iframe preview in this line, however I'm unsure why the fonts aren't then being loaded in the iframe context. I haven't been able to find anything that changed recently in the SPT picker that would've affected this. Could the recent GB upgrade have involved anything that could be related?

Browser / OS version

Tested on Chrome 88 and Firefox 95 on macOS

Is this specific to the applied theme? Which one?

This appears to affect the preview with any theme that uses an external / Google font. Good themes to test this with include Balasana and Dalston.

Level of impact (Does it block purchases? Does it affect more than just one site?)

It appears to affect the preview for any site using a theme that uses Google fonts.

CC: @simison it looks like this issue is resolved by removing the iframe in #49101 (but that doesn't explain why this issue has appeared just now)

@andrewserong
Copy link
Member Author

Fixed in #50253 and deployed to production in #50204. It turns out the cause was the the position in the DOM where the style tags get rendered was recently moved / tweaked in Gutenberg. The solution in #50253 was to better target the style tags when copying the styles to the iframe, so that we no longer expect them to be present at the root level / a direct child of the body element.

@andrewserong andrewserong added the [Closed] Fixed Issues explicitly fixed with PRs. Do not use for no longer reproducible issues. label Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Closed] Fixed Issues explicitly fixed with PRs. Do not use for no longer reproducible issues. Page Layouts [Status] Fix Inbound Use when a fix is in unreleased component [Type] Bug
Projects
None yet
Development

No branches or pull requests

2 participants