Skip to content

Commit

Permalink
Fix for generating icons to avoid re-building the sass each time
Browse files Browse the repository at this point in the history
  • Loading branch information
ediblecode committed Oct 17, 2016
1 parent 0d12773 commit 271f98e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/icons/nice-icons.tmpl.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
// See https://css-tricks.com/snippets/css/using-font-face/#article-header-id-0
// for cross-browser font face rule
%>

$${ fontBaseName }-no-cache: random(999999999);

@font-face {
font-family: "${ fontFamilyName }";
font-style: normal;
font-weight: normal;
src: ${ fontSrc1 };
src: ${ fontSrc2 };
src: ${ fontSrc1.replace(new RegExp(hash + "\"", "g"), "\" + $" + fontBaseName + "-no-cache") };
src: ${ fontSrc2.replace(new RegExp(hash + "\"", "g"), "\" + $" + fontBaseName + "-no-cache").replace(new RegExp(hash + "#", "g"), "\" + $" + fontBaseName + "-no-cache + \"#") };
}

// Map of icon name to codepoint
Expand Down
13 changes: 8 additions & 5 deletions src/stylesheets/typography/_typography-icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
// Generated by grunt-webfont



$typography-icons-no-cache: random(999999999);

@font-face {
font-family: "NICE Icons";
font-style: normal;
font-weight: normal;
src: url("/fonts/nice-icons.eot?7e395f578042349a790adc34eb09493e");
src: url("/fonts/nice-icons.eot?" + $typography-icons-no-cache);
src: url("/fonts/nice-icons.eot?#iefix") format("embedded-opentype"),
url("/fonts/nice-icons.woff2?7e395f578042349a790adc34eb09493e") format("woff2"),
url("/fonts/nice-icons.woff?7e395f578042349a790adc34eb09493e") format("woff"),
url("/fonts/nice-icons.ttf?7e395f578042349a790adc34eb09493e") format("truetype"),
url("/fonts/nice-icons.svg?7e395f578042349a790adc34eb09493e#typography-icons") format("svg");
url("/fonts/nice-icons.woff2?" + $typography-icons-no-cache) format("woff2"),
url("/fonts/nice-icons.woff?" + $typography-icons-no-cache) format("woff"),
url("/fonts/nice-icons.ttf?" + $typography-icons-no-cache) format("truetype"),
url("/fonts/nice-icons.svg?" + $typography-icons-no-cache + "#typography-icons") format("svg");
}

// Map of icon name to codepoint
Expand Down

0 comments on commit 271f98e

Please sign in to comment.