- This topic has 5 replies, 2 voices, and was last updated 3 years, 3 months ago by
David.
-
AuthorPosts
-
March 1, 2023 at 2:41 pm #2551958
James
Hi there,
I am using GeneratePress for a new site, where I am using the block editor but with essentially custom ACF blocks exclusively to offer editing flexibility while maintaining a high level of control.
So, for example, I have my own heading block where I can take text and other custom settings related to that heading. This works fine on the front end, but I am noticing on the backend that the default generatepress typography styles, specifically the .editor-styles-wrapper h1, that gets injected inline before the block editor override my intended styling. If I go into the inspector and disable these styles, my heading look as I want it in the block editor.
I don’t want to disable all of GeneratePress’ block editor styles, but so far I would like to disable the typography styling.
Is that possible?
March 2, 2023 at 3:57 am #2552497David
StaffCustomer SupportHi there,
we write all theme styles to the editor and excluding one style is not an option.
I assume that your ACF has specific styles on the front end ?
If so how are those styles added ?March 2, 2023 at 5:13 am #2552583James
Thanks, David
I made some progress since posting the question. Switched from using enqueue_block_editor_assets to add my css file to the backend, to instead using add_editor_style with a high numeric priority so they come last. While I’ll still need to overrides to get things right, it’s already much better.
Is using add_editor_style() the best option in your opinion?
March 2, 2023 at 7:06 am #2552716David
StaffCustomer SupportYep thats what we use in the theme:
and we provide our own filter
generate_editor_stylesif you want to piggy back on that.To cover all based there is also
block_editor_settings_allwhich has a lot of options:https://developer.wordpress.org/reference/hooks/block_editor_settings_all/
an example of it can be found in this forum eg. adding Customizer > Additional CSS to the editor:
add_filter( 'block_editor_settings_all', function( $editor_settings ) { $css = wp_get_custom_css_post()->post_content; $editor_settings['styles'][] = array( 'css' => $css ); return $editor_settings; } );Choices 🙂
March 2, 2023 at 7:10 am #2552723James
Thanks, yeah I came across that example in other posts as well
March 2, 2023 at 8:04 am #2552932David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.