-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix Global Styles on wpcom #40690
Fix Global Styles on wpcom #40690
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
apps/full-site-editing/full-site-editing-plugin/global-styles/src/dom-updater.js
Outdated
Show resolved
Hide resolved
Squeezing a quick pass-by comment in case it's any helpful: code looks fine to me. Thanks for the quick turn-around @noahtallen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well for me.
Changes proposed in this Pull Request
#40489 broke global styles inside the iFrame (changing a font did not change the font inside the preview). This fixes that.
The root cause is that the
<style />
element we dynamically update for Global Styles was not appended at the end of the other<style />
elements. I'm not quite sure why, but it seems that this script can begin executing before all the style elements have been loaded. So the fix is to wait some time to add the style element. I chose theisEditorReady
selector for this, but there could be a better heuristic. At any rate, this fixes the issue for me.Testing instructions