Search code examples
githubjekyllgithub-pages

How to change font size on blog pages created on Github using JekyllNow


I created a Github.io blog using JekyllNow. JekyllNow allows you to create it fully on the web itself without having git or Ruby installed locally. i.e. everything was done without any local operation.

I am using the minimal theme. My page is created but the font seems very big. How do I change the font sizes on the page?

If there is a way to make it proportional, that would be even better - i.e. i.e. not just the default font size but also, H1, H2 etc sizes also are proportionally smaller.


Solution

  • Normally we edit the file style.scss located at the root of the jekyll instance.

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

    But, if you are using the default Jekyll theme "Minima", you will have to edit the file minima.scss instead of the style.scss.

    So, To change the default font size definition you need to reset the value of `$base-font-size'

    $base-font-size:   16px !default;
    

    Also you can change the default font definition itself by resetting the value of $base-font-family variable,

    $base-font-family: "PT Serif", serif;
    

    You will also need to remove the !default; suffix at the end of this setting for the new font to be applicable.