forked from mirror/_s
Load WooCommerce Star fonts via inline styles.
This commit is contained in:
parent
db7f3ed04f
commit
24b0596c71
|
@ -30,6 +30,20 @@ add_action( 'after_setup_theme', '_s_woocommerce_setup' );
|
||||||
*/
|
*/
|
||||||
function _s_woocommerce_scripts() {
|
function _s_woocommerce_scripts() {
|
||||||
wp_enqueue_style( '_s-woocommerce-style', get_template_directory_uri() . '/woocommerce.css' );
|
wp_enqueue_style( '_s-woocommerce-style', get_template_directory_uri() . '/woocommerce.css' );
|
||||||
|
|
||||||
|
$font_path = WC()->plugin_url() . '/assets/fonts/';
|
||||||
|
$inline_font = '@font-face {
|
||||||
|
font-family: "star";
|
||||||
|
src: url("' . $font_path . 'star.eot");
|
||||||
|
src: url("' . $font_path . 'star.eot?#iefix") format("embedded-opentype"),
|
||||||
|
url("' . $font_path . 'star.woff") format("woff"),
|
||||||
|
url("' . $font_path . 'star.ttf") format("truetype"),
|
||||||
|
url("' . $font_path . 'star.svg#star") format("svg");
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
}';
|
||||||
|
|
||||||
|
wp_add_inline_style( '_s-woocommerce-style', $inline_font );
|
||||||
}
|
}
|
||||||
add_action( 'wp_enqueue_scripts', '_s_woocommerce_scripts' );
|
add_action( 'wp_enqueue_scripts', '_s_woocommerce_scripts' );
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,6 @@ Theme Name: _s
|
||||||
WooCommerce styles override
|
WooCommerce styles override
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* WooCommerce Plugin path variables
|
|
||||||
*/
|
|
||||||
$woocommerce__plugin-path: '../../plugins/woocommerce/';
|
|
||||||
$woocommerce__plugin-assets-font-path: '#{$woocommerce__plugin-path}assets/fonts/';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WooCommerce color variables
|
* WooCommerce color variables
|
||||||
*/
|
*/
|
||||||
|
@ -23,20 +17,6 @@ $woocommerce__color-info: #3D9CD2;
|
||||||
@import "variables-site/variables-site";
|
@import "variables-site/variables-site";
|
||||||
@import "mixins/mixins-master";
|
@import "mixins/mixins-master";
|
||||||
|
|
||||||
/**
|
|
||||||
* Fonts
|
|
||||||
*/
|
|
||||||
@font-face {
|
|
||||||
font-family: 'star';
|
|
||||||
src: url('#{$woocommerce__plugin-assets-font-path}star.eot');
|
|
||||||
src: url('#{$woocommerce__plugin-assets-font-path}star.eot?#iefix') format('embedded-opentype'),
|
|
||||||
url('#{$woocommerce__plugin-assets-font-path}star.woff') format('woff'),
|
|
||||||
url('#{$woocommerce__plugin-assets-font-path}star.ttf') format('truetype'),
|
|
||||||
url('#{$woocommerce__plugin-assets-font-path}star.svg#star') format('svg');
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shop tables
|
* Shop tables
|
||||||
*/
|
*/
|
||||||
|
|
Reference in New Issue