I have the following folder structure:
style.scss looks like this:
@import "mixins.scss";
@import "theme/**.scss";
Everything from style.scss is compiled within theme.min.css.
In _mixin.scss, I have a mixin for font-face:
@mixin font-face($font-name, $file-name, $weight: normal, $style: normal) {
@font-face {
font-family: quote($font-name);
src: url($file-name + '.eot');
src: url($file-name + '.eot?#iefix') format('embedded-opentype'),
url($file-name + '.otf') format('otf'),
url($file-name + '.woff') format('woff'),
url($file-name + '.woff2') format('woff2'),
url($file-name + '.ttf') format('truetype'),
url($file-name + '.svg##{$font-name}') format('svg');
font-weight: $weight;
font-style: $style;
font-display: swap;
}
}
@mixin lemonmilk-bold{
@include font-face("lemonmilk", "/assets/build/fonts/lemon-milk/bold/lemonmilk-bold", $style: normal, $weight: normal);
}
And in _typography.scss, I have the following:
h1{
@include lemonmilk-bold;
}
However, the font styles do not apply on the front end?
I thought it was something to do with the folder path maybe (as all styles get compiled to theme.min.css). But, changing the paths did nothing for me too.
Unsure where I am going wrong?
