-
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
Only load Premium Block CSS when that block is being used #42590
Conversation
Currently when you activate the Full Site Editing plugin the style.css for the Premium Content Block gets loaded on ever page view. This change adjusts it to only load on pages where that block is being used.
Caution: This PR affects files in the FSE Plugin on WordPress.com D43853-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing in the FSE Plugin for more info: PCYsg-ly5-p2 |
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. |
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.
Close, but it looks like we have some shared styling we'll need to pull out of
wp-calypso/apps/full-site-editing/full-site-editing-plugin/premium-content/style.css
Line 2 in 3372459
* The following styles get applied both on the front of your site |
Let's also update the comment at the top of style.css to note that this will be added to the published view only. @sixhours @danhauk or @Automattic/serenity @Automattic/earn any interest in helping sort styling?
Before | After |
---|---|
![]() |
![]() |
I copied over the styles that were needed in the editor. The toolbar styles shouldn't have been in style.css at all so I moved those too. |
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.
Thanks @josephscott for the optimization and @eoigal for the style cleanup! I verified that the editor styles look reasonable and that the published pages look good.
I did spot some minor focus changes before and after, but they both look a little off, so this is non-blocking.
Currently when you activate the Full Site Editing plugin the style.css for the Premium Content Block gets loaded on ever page view. This change adjusts it to only load on pages where that block is being used.
Changes proposed in this Pull Request
Testing instructions
Fixes #