-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
BlockPreview should render styles #30680
Comments
Thanks for ticketing this! On the one hand this seems like a logical extension of the stylesheet being loaded into the site editor iframe, and so the On the other hand, I could swear this used to be working, not that long ago. @ellatrix do you recall if this broke with the iframe and have been broken since? |
I can replicate this for most patterns where the theme adds specific styling. I haven't confirmed, but I suspect that the theme css isn't being loaded in the iframe context? This is tested with the current master branch (10.6.0-rc.1) using TT1 blocks, and no modifications:
There's a related issue over here: #31022 |
Well the popover is not part of the iframe. So even if the editor style is loaded inside the iframe, it's not loaded outside the iframe: So it seems the solution is to either also load the editor style outside the iframe, in the site editor, or wrap each preview inside other iframes that load the editor styles. |
Ah sorry for the red herring there. Thanks for the extra info. |
Should be fixed after #28165. |
Description
While reviewing this issue we noticed that the previews in the Full Site Editor (FSE) template sidebar don't truly represent the design in the editor.
The reason seems to be that the BlockPreview component doesn't load styles (in this case, the ones from the editor) or the way this component is used in the template preview. In any case, fixing the previews by loading the editor styles could help users better identify the different templates while they work with the FSE.
Step-by-step reproduction instructions
Expected behaviour
The template previews should show a red background.
Actual behaviour
The template previews show a white background.
Screenshots or screen recording
The code rendered by the component doesn't seem to include any CSS related to the theme:
WordPress information
CC @annezazu @jasmussen
The text was updated successfully, but these errors were encountered: