Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SCSS: How can import a Google Font inside a SCSS file?

I'm trying to import a Google Font inside the main.scss file, but following code didn't work:

@import url("//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700");

Is there a way to do that? I looking for this question in stackoverflow, but I don't find a concrete answer...

Can somebody help me?

like image 401
Albert Font Avatar asked Sep 28 '16 08:09

Albert Font


2 Answers

Instead of using url(), try the below:

@import 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700';

like image 90
heyitsjhu Avatar answered Nov 02 '22 16:11

heyitsjhu


The correct syntax for importing Google Fonts into Sass:

@import url('https://fonts.googleapis.com/css2?family=Alegreya + Sans + SC:wght@400;500;800');
like image 21
Hany Afifi Avatar answered Nov 02 '22 16:11

Hany Afifi