I am struggling to add roboto font. I know it sounds simple, I am not from front-end background. The section on font simply takes me to google font site which offers to include the rel link or use @import - how do I do that with react components? Or I am missing something simple?
<h1>
or <p>
and they become in such font?I believe question is relevant here because typography and its usage is under-documented.
Thanks,
The way to include the Roboto font is by doing the following.
font-family: 'Roboto', sans-serif;
If you want to use if for the website just copy this css.
html {
font-family: 'Roboto', sans-serif;
}
If you don't know what you're doing then the easiest way is to use the first option which is to copy the generated <link>
tag and paste it in between the <head></head>
tags of the html files you are using for the react app.
What if I need to package my app for offline use? Which font styles to use?
I've already asked on Stackoverflow, but got no answer.
Most helpful comment
The way to include the Roboto font is by doing the following.
font-family: 'Roboto', sans-serif;
If you want to use if for the website just copy this css.html { font-family: 'Roboto', sans-serif; }
If you don't know what you're doing then the easiest way is to use the first option which is to copy the generated
<link>
tag and paste it in between the<head></head>
tags of the html files you are using for the react app.