9

I'm new to using Jekyll, css, etc, and I forked the Jekyll now repo. Is there a way I can change, or add, default fonts to the entire jekyll website? It looks like this post may have some answers, but I don't really understand it.

Community
  • 1
  • 1
doubledaffy888
  • 93
  • 1
  • 1
  • 3

3 Answers3

9

Edit the file style.scss located at the root of the jekyll instance, you can change the font from this:

body {
  ...
  font: 18px/1.4 $helvetica;
}

to this:

body {
      font-family: "Times New Roman", Times, serif;
}

or whatever font you want.

If you want to make it better, use variables, add them to _sass/_variables.css

$times: "Times New Roman", sans-serif;

and then change in style.scss:

body {
    font: 18px/1.4 $times;
}
marcanuy
  • 23,118
  • 9
  • 64
  • 113
  • 3
    If you are using the default Jekyll theme "Minima", please edit the file `minima.scss` instead of the `style.scss`. To change the default font definition you need to reset the value of `$base-font-family` variable, e.g.: `$base-font-family: "PT Serif", serif;` You will also need to remove the `!default;` suffix at the end of this setting. – mabalenk Apr 12 '18 at 09:47
  • @mabalenk is this comment still accurate or does Minima now use `style.scss` also? [Minima source code reference](https://github.com/jekyll/minima/tree/master/assets/css) – Marklar Jan 17 '20 at 03:11
2

check this Font change Jekyll

The answer you mention telling is to edit your _config.yml file by adding the font names. i prefer add your font in sass file.

PMArtz
  • 148
  • 9
1

If you want to add a font asset to your project instead of using web-hosted fonts, you can import the font file into the project's assets folder. For the theme I'm using (minimal-mistakes), the correct assets folder is located in ROOT/docs/assets/

jungledev
  • 4,195
  • 1
  • 37
  • 52