-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
When previewing themes the style of the widgets don't match #32629
Comments
What precisely do you mean by "they should match". Is this a dupe of #26163? |
It's not a dupe I believe. The problem here is that the editor in the Customizer styles the widgets and blocks to match the active theme not the one being previewed. If we eventually drop editor styles from the Widgets editor, hence the Customizer as well, then this issue won't exist anymore. |
Ah, I see! The problem is that the Legacy Widget block preview renders using the site's active theme and not the theme being previewed in the current changeset. Thanks for clarifying. |
I wonder if we should disable the Legacy Widgets "preview mode" in the Customizer. It's not very useful because there is already a preview on the right hand side, and it's confusing that the two previews look different. What do you think, @critterverse? |
Could we disable preview mode only when live previewing a different theme? I'm not opposed to making that change universally, just curious what the other possibilities are. |
We most certainly could! |
I have heard (but unfortunately did not bookmark) others suggesting the same as an UX improvement for the customizer. |
@noisysocks even if we disable legacy preview mode this is not solved since my testing appears to be using a search block, not some legacy widget. The block editor needs to reload its CSS when we preview another theme. I have no idea if this can be done on the fly. |
Right. So in the original comment's screenshot, that's a Search block and not a Legacy Widget block? And you would expect the search button to appear red, not black? |
Related: #33264 |
Yes. |
Got it 😀 thanks for clarifying. I mistakenly thought this was about the Legacy Widget block. So, this happens by design. We don't load editor styles in the Customizer widgets block editor (that is: it's equivalent to turning Use theme styles off in the post block editor preferences) because there is already a preview of what the content will look like on the right hand side of the screen. Maybe it's something we'll revisit in the future but for now this is working as expected. |
Yes, excellent, I believe the problem was found when we did load the styles. |
When previewing themes using the Customizer the style of the widgets in the widgets editor sidebar is the one of the currently active theme.
To reproduce:
Expected behavior:
The styles should match
Screenshot
The text was updated successfully, but these errors were encountered: