-
Notifications
You must be signed in to change notification settings - Fork 41
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
Pattern Preview: Update styles to match editor. #419
Conversation
b8aa019
to
0cc0d56
Compare
@StevenDufresne It looks like this is a bug from Gutenberg — I can reproduce the same issue across themes in the post editor on another test site, a style applied to buttons with |
I can't remember specifically, but everything was done through the interface. I can try to retrace my steps if you would like. |
Hm, don't worry about it for now— we know it's not a bug with the creator, so if you did manage to reproduce it, it should be reported up to gutenberg. |
Fixes #416 — The pattern content rendered in the preview frame is pulled from the API, and is only the post content. On regular page loads, there are extra styles output in the footer for alignment, spacing, and link color (if applicable). These were not being added to the preview, causing differences between editor & frontend. Additionally, the default preset classes were not loaded, so background colors, etc, were not applied.
style
tag issues, I've copied over the gutenberg code to render these styles, and am injecting them directly into the content. This should only be a temporary fix, until the Style Engine work is done, since one of the bugs mentioned is this issue with API responses.global-styles
in wporg-mu-plugins), so those are loaded in when generating the styles to inject into the preview iframe. They're immediately unregistered to avoid overwriting the properties for the header & footer (see Unregister theglobal-styles
from classic themes wporg-mu-plugins#166).Screenshots
How to test the changes in this Pull Request: