Gergő Horváth
Gergő Horváth

Reputation: 3705

How to import a stylesheet from external source in react?

I mean icons from fontawesome or fonts from google fonts. In HTML i place something like this in the head:

<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">

What about react?

Upvotes: 12

Views: 27248

Answers (2)

jadlmir
jadlmir

Reputation: 505

inset the link in your index.html

<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">

Upvotes: 4

Friday Ameh
Friday Ameh

Reputation: 1684

You can just import it in your style sheet like so

    @import url('https://fonts.googleapis.com/css?family=Roboto');

And your body style will become

body {
  font-family: 'Roboto';
}

Upvotes: 26

Related Questions