I have two "ttf" Font files that I have to use with Sass - SCSS and I can't use it directly from the folder
My _mixin.scss file:
@mixin font-face($font-name, $font-path, $font-weight, $font-style) {
@font-face {
font-family: "Lato-Bold";
src: url("../../css/fonts/Lato/Lato-Bold.ttf") format('truetype');
font-weight: 700;
font-style: bold;
}
}
This is correct?
this give me an ERROR when compile..it's my first time using font-face and ttf files. This is a project, so I can't add other fonts, I have to use it like that, can you help me?
How can I use this mixin, how to include in my font-family in my CSS and/or Html?
I'm trying to write this in my _typography.scss file and this give an error":
@include font-face("Lato-Bold", "../../css/fonts/Lato/Lato-Bold", 700, bold);
ERROR in ./src/scss/main.scss (./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.js!./src/scss/main.scss) Module not found: Error: Can't resolve '../../css/fonts/Lato/Lato-Bold.ttf' in '/Users/****/Desktop/****/src/scss' @ ./src/scss/main.scss (./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.js!./src/scss/main.scss)
Ps: I'm using webpack.config.js | webpack-dev-server and compiling sass with --watch
Thank you for your help!