diff --git a/inc/services/assets.php b/inc/services/assets.php index 6ab29067..0f47a05c 100644 --- a/inc/services/assets.php +++ b/inc/services/assets.php @@ -145,6 +145,9 @@ public function get_min_file( $type ) { case 'css': $file = $assets['app.css']; break; + case 'editor-style': + $file = $assets['editor-style.css']; + break; case 'js': $file = $assets['app.js']; break; diff --git a/inc/services/theme.php b/inc/services/theme.php index b961c10c..64156ab8 100644 --- a/inc/services/theme.php +++ b/inc/services/theme.php @@ -1,6 +1,7 @@ get_service( 'assets' )->get_min_file( 'editor-style' ); + } + + /** + * Do not enqueue a inexistant file on admin + */ + if ( ! is_file( get_theme_file_path( 'dist/assets/' . $file ) ) ) { + return; + } + + add_editor_style( 'dist/assets/' . $file ); } }