Page layout picker: Fix broken web fonts in page layout picker large preview #50253
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the page layout picker, the existing code that looks to copy over styles to the iframe no longer targets the correct style tags, causing the preview to miss crucial style tags for rendering the web fonts from Global Styles correctly.
This change targets getting the styles from where they're inserted in the visual editor in Gutenberg, which is as children of the
.edit-post-visual-editor
node (the relevant line in Gutenberg is here).This fixes the rendering issue reported in #49742.
Changes proposed in this Pull Request
style
tags within the post body that we require to adequately style the preview, to avoid CSS conflicts that broke web fonts in the preview.readme.txt
file is just to trigger an ETK build. I'll remove the whitespace change before merging.Screenshot
Before:
After:
Testing instructions
Related to #49742