-
Notifications
You must be signed in to change notification settings - Fork 18
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 loading of style.css inside the editor #108
Conversation
The previous change to `render_callback` meant that `style.css` didn’t load inside the editor (no blocks are rendered). Go back to using the normal `style` param when registering the block, and let Gutenberg decide when to load the style
Does the style still load on frontend only when the block is rendered? :-) Alternatively you could |
FYI @Automattic/ganon would be good to check if template API still needs D45267-code |
This change makes it load
It won't affect that, which refers to |
Right, that's been problematic for performance on .com and reason why it was changed in first place here. :-) Imagine if every WordPress page would load CSS+JS for every block ever shipped on .com. We don't have this problem on Jetpack for example because we use combination of sass imports and |
It was specifically
Sure, I get that, and it affects every site not just those on WordPress.com. Gutenberg is working on this (WordPress/gutenberg#22754) so the situation will hopefully improve. With this change we are in a better performing position than the block has been in from the start (i.e. It may not be the most performant position, but this will be improved in future work. |
Thanks for elaborating! :-) |
Just to be sure, I tried testing the endpoint with that diff reverted, and it looks like we still need it. |
The previous change to
render_callback
meant thatstyle.css
didn’t load inside the editor (no blocks are rendered).Go back to using the normal
style
param when registering the block, and let Gutenberg decide when to load the styleFixes #103