FSE: Fix icon fonts not being loaded in the Site Editor (#35532)

* Site Editor: Fix WooCommerce icons in the Site Editor

* Site Editor: Fix WooCommerce icons not loading in the site editor.

* Add additional FSE theme check
This commit is contained in:
Daniel Dudzic 2022-11-15 09:58:40 +01:00 committed by GitHub
parent 63242cfa62
commit f9dacb78a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
Fix WooCommerce icons not loading in the site editor.

View File

@ -2,6 +2,7 @@
* woocommerce-blocktheme.scss
* Block theme default styles to ensure WooCommerce looks better out of the box with block themes that are not optimised for WooCommerce specifically.
*/
@import "fonts";
@import "variables";
/**

View File

@ -57,6 +57,11 @@ if ( ! class_exists( 'WC_Admin_Assets', false ) ) :
if ( $screen && $screen->is_block_editor() ) {
wp_register_style( 'woocommerce-general', WC()->plugin_url() . '/assets/css/woocommerce.css', array(), $version );
wp_style_add_data( 'woocommerce-general', 'rtl', 'replace' );
if ( wc_current_theme_is_fse_theme() ) {
wp_register_style( 'woocommerce-blocktheme', WC()->plugin_url() . '/assets/css/woocommerce-blocktheme.css', array(), $version );
wp_style_add_data( 'woocommerce-blocktheme', 'rtl', 'replace' );
wp_enqueue_style( 'woocommerce-blocktheme' );
}
}
// Sitewide menu CSS.