From cdf0ba70e4f2169685a856918aa59dbfd660f001 Mon Sep 17 00:00:00 2001 From: Nico Andrade Date: Thu, 20 Dec 2018 10:10:51 -0300 Subject: [PATCH] css dependencies Make the editor.css load after style.css --- examples/01-single-block/src/init.php | 2 +- examples/02-single-block-ejected/src/init.php | 2 +- examples/03-multi-block/src/init.php | 2 +- examples/04-multi-block-ejected/src/init.php | 2 +- examples/05-a11y-input/src/init.php | 2 +- packages/cgb-scripts/template/src/init.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/01-single-block/src/init.php b/examples/01-single-block/src/init.php index d0e9188c..f29a8912 100644 --- a/examples/01-single-block/src/init.php +++ b/examples/01-single-block/src/init.php @@ -54,7 +54,7 @@ function single_block_cgb_editor_assets() { wp_enqueue_style( 'single_block-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. - array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. + array( 'wp-edit-blocks', 'single_block-cgb-style-css' ) // Dependency to include the CSS after it. // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. ); } diff --git a/examples/02-single-block-ejected/src/init.php b/examples/02-single-block-ejected/src/init.php index c56d3a6e..0d29d3e1 100644 --- a/examples/02-single-block-ejected/src/init.php +++ b/examples/02-single-block-ejected/src/init.php @@ -54,7 +54,7 @@ function single_block_cgb_editor_assets() { wp_enqueue_style( 'single_block-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. - array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. + array( 'wp-edit-blocks', 'single_block-cgb-style-css' ) // Dependency to include the CSS after it. // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. ); } // End function single_block_cgb_editor_assets(). diff --git a/examples/03-multi-block/src/init.php b/examples/03-multi-block/src/init.php index 75d313e6..8afd9c32 100644 --- a/examples/03-multi-block/src/init.php +++ b/examples/03-multi-block/src/init.php @@ -54,7 +54,7 @@ function multi_block_cgb_editor_assets() { wp_enqueue_style( 'multi_block-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. - array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. + array( 'wp-edit-blocks', 'multi_block-cgb-style-css' ) // Dependency to include the CSS after it. // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. ); } // End function multi_block_cgb_editor_assets(). diff --git a/examples/04-multi-block-ejected/src/init.php b/examples/04-multi-block-ejected/src/init.php index 75d313e6..8afd9c32 100644 --- a/examples/04-multi-block-ejected/src/init.php +++ b/examples/04-multi-block-ejected/src/init.php @@ -54,7 +54,7 @@ function multi_block_cgb_editor_assets() { wp_enqueue_style( 'multi_block-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. - array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. + array( 'wp-edit-blocks', 'multi_block-cgb-style-css' ) // Dependency to include the CSS after it. // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. ); } // End function multi_block_cgb_editor_assets(). diff --git a/examples/05-a11y-input/src/init.php b/examples/05-a11y-input/src/init.php index 51e65f28..34040780 100644 --- a/examples/05-a11y-input/src/init.php +++ b/examples/05-a11y-input/src/init.php @@ -55,7 +55,7 @@ function a11y_input_cgb_editor_assets() { wp_enqueue_style( 'a11y_input-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. - array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. + array( 'wp-edit-blocks', 'a11y_input-cgb-style-css' ) // Dependency to include the CSS after it. // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. ); } // End function a11y_input_cgb_editor_assets(). diff --git a/packages/cgb-scripts/template/src/init.php b/packages/cgb-scripts/template/src/init.php index 3df3b71e..aec07758 100644 --- a/packages/cgb-scripts/template/src/init.php +++ b/packages/cgb-scripts/template/src/init.php @@ -55,7 +55,7 @@ function <% blockNamePHPLower %>_cgb_editor_assets() { // phpcs:ignore wp_enqueue_style( '<% blockNamePHPLower %>-cgb-block-editor-css', // Handle. plugins_url( 'dist/blocks.editor.build.css', dirname( __FILE__ ) ), // Block editor CSS. - array( 'wp-edit-blocks' ) // Dependency to include the CSS after it. + array( 'wp-edit-blocks', '<% blockNamePHPLower %>-cgb-style-css' ) // Dependency to include the CSS after it. // filemtime( plugin_dir_path( __DIR__ ) . 'dist/blocks.editor.build.css' ) // Version: File modification time. ); }