@@ -26,7 +26,6 @@ public function __construct() {
26
26
add_action ( 'after_setup_theme ' , array ( $ this , 'setup ' ) );
27
27
add_filter ( 'body_class ' , array ( $ this , 'woocommerce_body_class ' ) );
28
28
add_action ( 'wp_enqueue_scripts ' , array ( $ this , 'woocommerce_scripts ' ), 20 );
29
- add_filter ( 'woocommerce_enqueue_styles ' , '__return_empty_array ' );
30
29
add_filter ( 'woocommerce_output_related_products_args ' , array ( $ this , 'related_products_args ' ) );
31
30
add_filter ( 'woocommerce_product_thumbnails_columns ' , array ( $ this , 'thumbnail_columns ' ) );
32
31
add_filter ( 'woocommerce_breadcrumb_defaults ' , array ( $ this , 'change_breadcrumb_delimiter ' ) );
@@ -35,6 +34,10 @@ public function __construct() {
35
34
add_action ( 'storefront_woocommerce_setup ' , array ( $ this , 'setup_integrations ' ) );
36
35
add_action ( 'wp_enqueue_scripts ' , array ( $ this , 'woocommerce_integrations_scripts ' ), 99 );
37
36
add_action ( 'wp_enqueue_scripts ' , array ( $ this , 'add_customizer_css ' ), 140 );
37
+
38
+ // Instead of loading Core CSS files, we only register the font families.
39
+ add_filter ( 'woocommerce_enqueue_styles ' , '__return_empty_array ' );
40
+ add_filter ( 'wp_enqueue_scripts ' , array ( $ this , 'add_core_fonts ' ), 130 );
38
41
}
39
42
40
43
/**
@@ -89,6 +92,41 @@ public function add_customizer_css() {
89
92
wp_add_inline_style ( 'storefront-woocommerce-style ' , $ this ->get_woocommerce_extension_css () );
90
93
}
91
94
95
+ /**
96
+ * Add CSS in <head> to register WooCommerce Core fonts.
97
+ *
98
+ * @since 3.4.0
99
+ * @return void
100
+ */
101
+ public function add_core_fonts () {
102
+ $ fonts_url = plugins_url ( '/woocommerce/assets/fonts/ ' );
103
+ wp_add_inline_style (
104
+ 'storefront-woocommerce-style ' ,
105
+ '@font-face {
106
+ font-family: star;
107
+ src: url( ' . $ fonts_url . '/star.eot);
108
+ src:
109
+ url( ' . $ fonts_url . '/star.eot?#iefix) format("embedded-opentype"),
110
+ url( ' . $ fonts_url . '/star.woff) format("woff"),
111
+ url( ' . $ fonts_url . '/star.ttf) format("truetype"),
112
+ url( ' . $ fonts_url . '/star.svg#star) format("svg");
113
+ font-weight: 400;
114
+ font-style: normal;
115
+ }
116
+ @font-face {
117
+ font-family: WooCommerce;
118
+ src: url( ' . $ fonts_url . '/WooCommerce.eot);
119
+ src:
120
+ url( ' . $ fonts_url . '/WooCommerce.eot?#iefix) format("embedded-opentype"),
121
+ url( ' . $ fonts_url . '/WooCommerce.woff) format("woff"),
122
+ url( ' . $ fonts_url . '/WooCommerce.ttf) format("truetype"),
123
+ url( ' . $ fonts_url . '/WooCommerce.svg#WooCommerce) format("svg");
124
+ font-weight: 400;
125
+ font-style: normal;
126
+ } '
127
+ );
128
+ }
129
+
92
130
/**
93
131
* Assign styles to individual theme mod.
94
132
*
0 commit comments