mirror of
https://github.com/woocommerce/storefront.git
synced 2025-10-03 14:04:42 +08:00
Fix missing icons (#1588)
* Revert "Remove custom WooCommerce font usage (#1574)" This reverts commitc8e98b09d4
. * Load CSS fonts from PHP side so path can be dynamic * Revert "Revert "Remove custom WooCommerce font usage (#1574)"" This reverts commit29c7f291d3
. * Fix wrong icons in messages and errors
This commit is contained in:
parent
fa92f79472
commit
5a3619d4db
2 changed files with 40 additions and 10 deletions
|
@ -1997,15 +1997,7 @@ p.no-comments {
|
|||
.woocommerce-message {
|
||||
|
||||
&::before {
|
||||
content: "\e015";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.woocommerce-error {
|
||||
|
||||
&::before {
|
||||
content: "\e016";
|
||||
content: "\f058";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
|
|||
add_action( 'after_setup_theme', array( $this, 'setup' ) );
|
||||
add_filter( 'body_class', array( $this, 'woocommerce_body_class' ) );
|
||||
add_action( 'wp_enqueue_scripts', array( $this, 'woocommerce_scripts' ), 20 );
|
||||
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
|
||||
add_filter( 'woocommerce_output_related_products_args', array( $this, 'related_products_args' ) );
|
||||
add_filter( 'woocommerce_product_thumbnails_columns', array( $this, 'thumbnail_columns' ) );
|
||||
add_filter( 'woocommerce_breadcrumb_defaults', array( $this, 'change_breadcrumb_delimiter' ) );
|
||||
|
@ -35,6 +34,10 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
|
|||
add_action( 'storefront_woocommerce_setup', array( $this, 'setup_integrations' ) );
|
||||
add_action( 'wp_enqueue_scripts', array( $this, 'woocommerce_integrations_scripts' ), 99 );
|
||||
add_action( 'wp_enqueue_scripts', array( $this, 'add_customizer_css' ), 140 );
|
||||
|
||||
// Instead of loading Core CSS files, we only register the font families.
|
||||
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
|
||||
add_filter( 'wp_enqueue_scripts', array( $this, 'add_core_fonts' ), 130 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -89,6 +92,41 @@ if ( ! class_exists( 'Storefront_WooCommerce' ) ) :
|
|||
wp_add_inline_style( 'storefront-woocommerce-style', $this->get_woocommerce_extension_css() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add CSS in <head> to register WooCommerce Core fonts.
|
||||
*
|
||||
* @since 3.4.0
|
||||
* @return void
|
||||
*/
|
||||
public function add_core_fonts() {
|
||||
$fonts_url = plugins_url( '/woocommerce/assets/fonts/' );
|
||||
wp_add_inline_style(
|
||||
'storefront-woocommerce-style',
|
||||
'@font-face {
|
||||
font-family: star;
|
||||
src: url(' . $fonts_url . '/star.eot);
|
||||
src:
|
||||
url(' . $fonts_url . '/star.eot?#iefix) format("embedded-opentype"),
|
||||
url(' . $fonts_url . '/star.woff) format("woff"),
|
||||
url(' . $fonts_url . '/star.ttf) format("truetype"),
|
||||
url(' . $fonts_url . '/star.svg#star) format("svg");
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
}
|
||||
@font-face {
|
||||
font-family: WooCommerce;
|
||||
src: url(' . $fonts_url . '/WooCommerce.eot);
|
||||
src:
|
||||
url(' . $fonts_url . '/WooCommerce.eot?#iefix) format("embedded-opentype"),
|
||||
url(' . $fonts_url . '/WooCommerce.woff) format("woff"),
|
||||
url(' . $fonts_url . '/WooCommerce.ttf) format("truetype"),
|
||||
url(' . $fonts_url . '/WooCommerce.svg#WooCommerce) format("svg");
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
}'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign styles to individual theme mod.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue