エディター側にスタイルを適用する

【関数】add_theme_support( ‘editor-styles’ )
【関数】add_editor_style( スタイルシートへのパス )
独自のエディタースタイルをエディター側に反映させる。

function neko_block_setup(){
  add_theme_support( 'editor-styles' );  //独自のエディタースタイルを有効化する
  add_editor_style( 'assets/css/editor-styles.css' );  //独自のエディタースタイルを指定する
  add_editor_style( 'https://Googleフォントの読み込みURL' );  //エディター側にGoogleフォントを読み込む
}
add_action( 'after_setup_theme', 'neko_block_setup' );

【参考】
https://ja.wordpress.org/team/handbook/block-editor/how-to-guides/themes/theme-support/

inserted by FC2 system