-
Notifications
You must be signed in to change notification settings - Fork 4.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
In the block theme, I see a page with no styles applied for a moment. #38434
Comments
Hey, I can repro this and will look into it. Thanks for reporting. This is what I know so far: in WordPress 5.8 we introduced a mechanism to only load the CSS of blocks in use. AFAIK, that required a change for classic themes that opted-in into this mechanism, and the styles loaded at the bottom of the body for them. In the other cases (classic that didn't opt-in or block themes) the styles would still be loaded in the Somehow, in WordPress 5.9, we've regressed this and they always load in the footer of the body for block themes as well. |
Prepared a fix for WordPress core at WordPress/wordpress-develop#2303 linked to the trac issue https://core.trac.wordpress.org/ticket/53494#comment:40 |
@oandregal Thanks for opening the fix, this indeed fixes the layout shift due to the "global styles" stylesheet, but there's still a layout shift due to the block supports styles. Should we update these as well? Also, would be great if we can test this change in the Gutenberg plugin. |
Fix for loading |
@youknowriad yeah, the PRs above don't fix the issue completely. I need to look at the block styles (layout+elements) separately. |
Gutenberg PR for loading block styles (layout & element) in the head #38750 |
@iidastudio would you be able to test with Gutenberg from |
I'm going to close this issue for now. Thanks for you work André |
Description
In the block theme, When I view the page, I see a page with no styles applied for a moment.
I think the cause is that the block theme inserts the style generated from theme.json (global-styles-inline-css) just before the closing tag of the body.
Step-by-step reproduction instructions
If your transmission speed is too fast, you may not be able to check.
Screenshots, screen recording, code snippet
no-style.mov
Environment info
wp-env
WordPress 5.9
Gutenberg 12.4.1 or Gutenberg Disable
chrome
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: