From a39c53e1de5c1b3099b23d2441363900238ac204 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Fri, 23 May 2025 18:06:35 +0200 Subject: [PATCH] ENHANCE Update Gutenberg styles loading: conditionally enqueue parent theme styles if they exist, ensuring proper styling hierarchy in the block editor. --- includes/init.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/init.php b/includes/init.php index 863eabc..5d3b8f5 100644 --- a/includes/init.php +++ b/includes/init.php @@ -83,7 +83,12 @@ function dynamiques_enqueue_scripts() function dynamiques_enqueue_gutenberg_back_styles() { - wp_enqueue_style('tailpress_back', dynamiques_asset('css/app.css'), array()); + $theme = wp_get_theme(); + $parent_style = get_template_directory_uri() . '/css/app.css'; + if (file_exists(get_template_directory() . '/css/app.css')) { + wp_enqueue_style('parent-style', $parent_style, array(), $theme->get('Version')); + } + wp_enqueue_style('tailpress_back', dynamiques_asset('css/app.css'), array('parent-style')); } add_action('enqueue_block_editor_assets', 'dynamiques_enqueue_gutenberg_back_styles');