Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Google Fonts to Bootstrap 4 with SASS / Gulp

I try to implement Google Fonts (Dosis) into Bootstrap 4 using SASS / Gulp. I'm a total novice when it comes to SASS.

I managed to change the default colors using _custom.scss by defining $brand-primary, but when I want to do the same with the fonts by changing $font-family-sans-serif value it doesn't work. I restarted the server and included the Google fonts in the index.html with link tags...but still I can't get it to work.

like image 957
Peter Pupovac Avatar asked Dec 03 '17 19:12

Peter Pupovac


1 Answers

You can import the chosen Google Font at the top of your _custom.scss like so.

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

And you can define "Dosis" as a font family name like so:

$font-family-sans-serif: "Dosis", […other fonts…];

This should work once your sass is compiled.

like image 50
dferenc Avatar answered Sep 24 '22 00:09

dferenc