Repository navigation
Global Styles Preview: Don't use iframe component - #67682
Conversation
|
Size Change: -199 B (-0.01%) Total Size: 1.83 MB
ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
ramonjd
left a comment
There was a problem hiding this comment.
This is working well for me. I can't see any regressions. I also updates various global styles to confirm that no style bleed occurs. As you say, there are no block rendered.
Kapture.2024-12-07.at.10.44.14.mp4
|
@ramonjd Thanks for the review! |
See #67548 (review)
What?
This PR refactors the style preview, palette, and typography in the global styles without using the iframe component. This PR ensures that the style preview always renders correctly at mobile viewport sizes:
Why?
The
Iframecomponent doesn't render anything if the editor settings aren't initialized. To get around this issue we need to provide theBlockEditorProvider.However, the styles, palette and typography preview do not have any blocks. All styles should be determined via the global styles, so I don't think there is a need to use the
Iframecomponent.Additionally, moving away from the iframe component ensures that these previews can be rendered in any context.
How?
<PreviewIframe />to<PreviewWrapper />,.edit-site-global-styles-preview__iframeto.edit-site-global-styles-preview__wrapperTesting Instructions