how to add custom font to react project 1

how to add custom font to react project

@font-face {
  font-family: "AssistantRegular";
  src: local("AssistantRegular"),
    url("./fonts/assistant.regular.ttf") format("truetype");
  font-weight: normal;
}

Here is what the above code is Doing:
1. We’re creating a new font-face called AssistantRegular.
2. We’re telling the browser to look for the font locally first, and if it can’t find it, to use the url to download it.
3. We’re telling the browser that the font is a TrueType font.
4. We’re telling the browser that the font is normal weight.

Now that we’ve defined the font, we can use it in our CSS.

Similar Posts