I've been inserting CSS through the Customizer -> Additional CSS
. Then I will add some classes within the block editor to single blocks, using the Advanced -> additional css classes
field
My main issue is that such CSS classes have no effect whatsoever within the Block Editor: I will see any effects only if I create a preview of a page. This makes any editing quite cumbersome.
I've also tried to insert the css using the theme file editor instead of the customizer (through Appearance -> Theme File Editor
), but such css actually will not apply at all, might be an issue of the theme I use.
What is the best way to add CSS which will be applied already within the block editor, without need to use the preview?
add_editor_style()
or theenqueue_block_editor_assets
hook. See this comment, this article and maybe also wordpress.org/support/topic/…