Hi there,
I am struggling to find out what could be potential reasons why custom web font is properly loaded and displayed after running yarn build but not after running yarn build:production, another custom web font works properly after running both. Both kinds of compilations are finishing successfully.
Sample of not working @font-face
/* Guardian Egyptian Web font family DOES NOT WORK */
@font-face {
font-family: GuardianEgyp;
src: url('../fonts/GuardianEgyp/GuardianEgyp-Light-Web.eot');
src:
url('../fonts/GuardianEgyp/GuardianEgyp-Light-Web.eot?#iefix') format('embedded-opentype'),
url('../fonts/GuardianEgyp/GuardianEgyp-Light-Web.woff') format('woff'),
url('../fonts/GuardianEgyp/GuardianEgyp-Light-Web.ttf') format('truetype'),
url('../fonts/GuardianEgyp/GuardianEgyp-Light-Web.svg#Guardian Egyptian Web') format('svg');
font-weight: 300;
font-style: normal;
font-stretch: normal;
font-display: optional;
}
/* Garamond font family WORKS */
@font-face {
font-family: GaramondStd;
src: url('../fonts/Garamond/ITCGaramondStd-LtCondIta.eot');
src:
url('../fonts/Garamond/ITCGaramondStd-LtCondIta.eot?#iefix') format('embedded-opentype'),
url('../fonts/Garamond/ITCGaramondStd-LtCondIta.woff') format('woff'),
url('../fonts/Garamond/ITCGaramondStd-LtCondIta.ttf') format('truetype'),
url('../fonts/Garamond/ITCGaramondStd-LtCondIta.svg#ITCGaramondStd-LtCondIta') format('svg');
font-weight: 300;
font-style: italic;
font-display: optional;
}
$font-garamond: GaramondStd, serif;
$font-guardian: GuardianEgyp, serif;
Sample of @font-face from main.css after yarn build:production
@font-face{font-display:optional;font-family:Guardian-Egyp;font-stretch:normal;font-style:normal;font-weight:300;src:url(/wp-content/themes/pp-wp-theme/dist/fonts/GuardianEgyp/GuardianEgyp-Light-Web_f62efdc3.eot);src:url(/wp-content/themes/pp-wp-theme/dist/fonts/GuardianEgyp/GuardianEgyp-Light-Web_f62efdc3.eot?#iefix) format("embedded-opentype"),url(/wp-content/themes/pp-wp-theme/dist/fonts/GuardianEgyp/GuardianEgyp-Light-Web_e9d04cd0.woff) format("woff"),url(/wp-content/themes/pp-wp-theme/dist/fonts/GuardianEgyp/GuardianEgyp-Light-Web_9369ffc9.ttf) format("truetype"),url(/wp-content/themes/pp-wp-theme/dist/fonts/GuardianEgyp/GuardianEgyp-Light-Web_8fa9ccb5.svg#Guardian Egyptian Web) format("svg")}
Any ideas? Thank you for any suggestions I am getting desperate and starting to think about going live with assets generated by yarn build
Many thanks!