You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When blocks are added to post content they can appear very poorly in Reader mode. The reason for this is the block styles from core are not being included in the template. Before #2202 this was not feasible to do due to the lack of tree shaking, but now that it is resolved this is no longer the case.
The Reader mode templates should be made fully block-compatible by including the wp-block-library stylesheet in the template. What's more is that the templates should behave as if current_theme_supports( 'wp-block-styles' ) so that wp-block-library-theme is also added. In fact, the Reader mode templates should probably go ahead and call wp_common_block_scripts_and_styles() so that the enqueue_block_assets action is triggered. Any stylesheet that is enqueued as part of that should then get printed.
Feature description
When blocks are added to post content they can appear very poorly in Reader mode. The reason for this is the block styles from core are not being included in the template. Before #2202 this was not feasible to do due to the lack of tree shaking, but now that it is resolved this is no longer the case.
The Reader mode templates should be made fully block-compatible by including the
wp-block-library
stylesheet in the template. What's more is that the templates should behave as ifcurrent_theme_supports( 'wp-block-styles' )
so thatwp-block-library-theme
is also added. In fact, the Reader mode templates should probably go ahead and callwp_common_block_scripts_and_styles()
so that theenqueue_block_assets
action is triggered. Any stylesheet that is enqueued as part of that should then get printed.Related: #2044
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
The basic implementation can look like this:
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: