Skip to content

Commit

Permalink
Load WooCommerce Star fonts via inline styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagonoronha committed Aug 28, 2017
1 parent db7f3ed commit 24b0596
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
14 changes: 14 additions & 0 deletions inc/woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ function _s_woocommerce_setup() {
*/
function _s_woocommerce_scripts() {
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' );

Expand Down
20 changes: 0 additions & 20 deletions sass/woocommerce.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ Theme Name: _s
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
*/
Expand All @@ -23,20 +17,6 @@ $woocommerce__color-info: #3D9CD2;
@import "variables-site/variables-site";
@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
*/
Expand Down

0 comments on commit 24b0596

Please sign in to comment.