-
Notifications
You must be signed in to change notification settings - Fork 800
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
WP.com Block Editor: Enqueue missing common styles on the front-end. #14070
Conversation
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: December 3, 2019. |
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.
Would there be a way to not load this on each and every front-end page as soon as Jetpack is connected to WordPress.com? Ideally we'd only use it when the buttons are used in a post that's being displayed.
If that's not an option, maybe we should move those common styles to a stylesheet that's already loaded on each front-end page by Jetpack, such as the concatenated jetpack.css
.
@jeherve The current size of |
Good point! @gwwar I can add a |
10ee131
to
adb3ae8
Compare
I'm afraid I'm still getting fatal errors:
I'm less worried about the file size, and more about the added CSS enqueue, especially coming from a module that can't be easily disabled by most site owners and when the enqueue is not hosted on the site so can't be handled by most concatenating / caching plugins. Some folks monitor the different enqueues on their site very closely, and will not be happy to see us adding a file without an easy way to dequeue it (short of doing it via code). Since the file includes so little, wouldn't we better served by hosting it locally in Jetpack, and adding it to this list so it gets concatenated in Line 53 in ade7b28
As a result there won't be any additional enqueue, and we won't have to worry that the file is enqueued on all pages since |
object has paragraph blocks (the only blocks that have the Justify button).
paragraphs in the content.
4f2e218
to
f25842e
Compare
@jeherve With the latest updates, it'll only be enqueued if:
This way, it's only enqueued when truly needed, and we're not adding stuff to |
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.
This is just what we needed, thank you. It should be good to merge!
* 8.0 Release: running changelog * Changelog: add #13921 * Changelog: add #13980 * Changelog: add #13905 * Changelog: add #13971 * Changelog: add #13984 * Changelog: add #14009 * Changelog: add #13620 * Remove things that will ship in 7.9.1 * Changelog: add 7.9.1 release (#14044) * Changelog: add base for 7.9.1 release * Update release date and post link * Changelog: add #14066 * Update changelog for 7.9.1 * Changelog: add #13405 * Changelog: add #13841 * Changelog: add #13924 * Changelog: add #13986 * Changelog: add #14010, #14028, #14053, #14055. * Changelog: add #14054 * Changelog: add #14031 * Changelog: add #14039 * Changelog: add #14050 * Changelog: add #14070 * Changelog: add #14082 * Changelog: add #14084 * Changelog: add #14111 * Changelog: add #13961 * Changelog: add #14047 * Changelog: add #14091 * Changelog: add #14108 * Changelog: add #14121
Up to now, both the script and styles for the
common
module have been enqueued on theenqueue_block_editor_assets
hook; this left out necessary styles for justified text from being displayed on the front-end.This PR splits out the styles from
enqueue_scripts
, and enqueues them for both the editor and the front-end.Editor
Front-end
Testing instructions
Proposed changelog entry
[BUG] Fixed Justify styling for the WP.com Block Editor.