anon1990
anon1990

Reputation: 25

Using font awesome ttf with scss

I'm trying to use font awesome with scss.

@font-face {
  font-family: 'awesome';
  src: url('../../fonts/font-awesome/fa-light-300.ttf') format('ttf');
}

the path seems to be correct but i'm getting errors: Failed to compile.

./src/assets/styles/main.scss (./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-3-1!./node_modules/postcss-loader/src??ref--8-oneOf-3-2!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-3-3!./src/assets/styles/main.scss) Module not found: Error: Can't resolve '../../fonts/font-awesome/fa-light-300.ttf' in 'C:\Users\idogo\Desktop\‏‏תיקיה חדשה\sprint-4\src\assets\styles'

I hope you can help me, thanks

Upvotes: 0

Views: 392

Answers (1)

anon1990
anon1990

Reputation: 25

Appernetly all i needed is to add ~@ at the begining of the path.

@font-face {
  font-family: 'awesome';
  src: url('~@/fonts/font-awesome/fa-light-300.ttf') format('ttf');
}

Upvotes: 0

Related Questions