Closed diggeddy closed 1 month ago
Looks to me like it's being caused by this function: https://github.com/tomusborne/generateblocks/blob/1.9.0/includes/general.php#L461
However, this is the correct usage of the filter, and a valid way of adding styles to the editor.
I guess we would need to know exactly how Bricks is adding this CSS to the editor in the first place.
Bricks reply: https://forum.bricksbuilder.io/t/no-bug-gutenberg-editor-styles-disappear-after-generateblocks-plugin-activation/22250/2
OP reckons issue can be replicated in Kadence and Hello, but i could not.
However the issue seems to be more than just the use of generateblocks_do_block_css_reset
Any use of the block_editor_settings_all
filter whilst GB 1.9 is active will break the styles
To test:
remove_filter( 'block_editor_settings_all', 'generateblocks_do_block_css_reset', 15 );
`add_filter( 'block_editor_settings_all', 'custom_editor_styles', 15 );
// Function to apply CSS reset
function custom_editor_styles( $editor_settings ) {
$css = 'p {margin-bottom: 100px}';
// Add CSS to editor settings
$editor_settings['styles'][] = array(
'css' => $css,
);
return $editor_settings;
}
This will break the editor stylets too.
And another theme reported: https://generate.support/topic/possible-conflict-with-buddyboss-theme-editor-styles-lost/#post-106330
When I add the function above to an empty site using Bricks and no plugins, I see the issue happen as well.
Deactivating GB (or not having it at all) doesn't prevent the issue from happening for me if I'm using the block_editor_settings_all
filter anywhere else.
May have some relevance: https://forum.bricksbuilder.io/t/solved-how-to-load-editor-styles-in-gutenberg/12346/2
So the bottom line here is:
WP has editors styles reset.css and default.css that get loaded. Themes that DO NOT load editor styles return the default.css
If however you use the block_editor_settings_all
to load styles, such as we are in GB 1.9, WP changes the loading order of th styles resulting in the reset
overriding the default. So the users sees a change.
The fix for themes not loading editor styles is to uncheck Use theme styles in the editor: Editor > Top Bar > 3 dot menu -> Appearance –> Uncheck the Use theme styles
Description
Using Bricks theme, block editors styles do not load when using GB 1.9. If fallback to GB 1.8 then the styles do load. But is not that GB is loading any styles over the top - Bricks is just not outputting the necessary
.editor-styles-wrapper
CSS.Here is GB 1.8, where
.editor-styles-wrapper
existHere is GB 1.9 where they do not
So did we do anything in GB 1.9, possibly related to WP 6.5s changes to editor style loading that could be interfering?
For support topic reference: https://generate.support/topic/post-editor-styling-changed-after-updating-to-gb-1-9-and-gb-pro-1-7/page/2/#post-105042