Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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;
}
Comment

How to include custom fonts in a react project

/*Create a directory "fonts" in your src folder
Move your font files in the "fonts" directory
Create / In your App.css file, you can use them as followed
*/

@font-face {
  font-family: 'MyFont';
  src: local('MyFont'), url(./fonts/MyFont.woff) format('woff');
  /* other formats include: 'woff2', 'truetype, 'opentype',
                            'embedded-opentype', and 'svg' */
}

/*Import the App.css file in your App.js*/
Comment

add ttf font in react project

declare module "*.woff2"
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript get srollwidth 
Javascript :: check jquery page 
Javascript :: How to make blinking/flashing text with jQuery 
Javascript :: All Longest Strings javaScript 
Javascript :: react form submit values with name 
Javascript :: convert string to camel case 
Javascript :: JavaScript Use clearInterval() Method 
Javascript :: how to use useparams in react 
Javascript :: get id of element javascript 
Javascript :: unfocus javascript 
Javascript :: nested object javascript 
Javascript :: embed video by javascript 
Javascript :: toggle button javascript 
Javascript :: difference between react native and react 
Javascript :: How to Use the toLowerCase() String Method in javascript 
Javascript :: how to compare two time in moment js 
Javascript :: how to send enter event to input field jquery 
Javascript :: javascript foreach example 
Javascript :: mathjax new line 
Javascript :: debounce js 
Javascript :: js get html content 
Javascript :: vue fix eslint error 
Javascript :: js get element by index 
Javascript :: updateone mongoose example 
Javascript :: find input by value attribute javascript 
Javascript :: spawn template playcanvas 
Javascript :: How to replace a value in localstorage using javascript 
Javascript :: useeffect async await 
Javascript :: continuous scrolling js 
Javascript :: javascript anagram two strings 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =