homerThinking
homerThinking

Reputation: 865

How to use imported fonts in a VUE project?

I'm developing my first project of vue and following the different examples and the official documentation I can't solve a mistake when using the imported fonts in my project locally.console error

in my tag I import the font that I want to use in the component and then I refer to it when using it and it returns the error that I attached in the image


<style scooped>

@font-face {
    font-family: 'RalewayRegular';
    src: local('RalewayRegular'),
    url(../../fonts/Raleway-Regular.ttf) format('truetype');
    font-style: normal;
}

body {
  font-family: 'RalewayRegular';
}

.header {
  display: flex;
  justify-content: center;
  align-items: baseline;
}

.menu {
  list-style: none;
  display: flex;
  align-items: baseline;
}

.nav-item {
  padding: 25px;
  position: relative;
}

.nav-link:hover {
  color: #666B74;
}

.menu-link-toggle {
  cursor: pointer;
}

.dropdown-menu {
  list-style: none;
  position: absolute;
  padding: 10px;
  background-color: white;
  width: max-content;

}

a {
  font-size: 14px;
  color: #D53865;
  font-weight: bold;
  letter-spacing: 1px;
  text-decoration: none;
}

a:before {
  content: '';
  position: absolute;
  width: 30%;
  height: 3px;
  bottom: 30%;
  left: 35%;
  background: #D53865;
  visibility: hidden;
  border-radius: 5px;
  transform: scaleX(0);
  transition: .25s linear;
}

a:hover:before,
a:focus:before {
  visibility: visible;
  transform: scaleX(1);

}

.added {
  display: none;
}


</style>


Is there someone who is used to using VUE who can help me and tell me what my mistake is? Thank you in advance for your time and help

Upvotes: 3

Views: 1630

Answers (1)

dako
dako

Reputation: 1163

Looks like a webpack issue. You probably need a config. Check out this article

Upvotes: 1

Related Questions