Jekyll Variable in SCSS Files

April 16, 2016

You can use Jekyll site vari­ables in top-level SCSS files. For exam­ple:

{% raw %}$baseurl: '{{ site.baseurl }}';
{% endraw %}
@import 'fonts';

These site vari­ables will also vis­i­ble in par­tials that are import­ed after it:

// _fonts.scss

@font-face {
  src: url($baseurl + "/assets/fonts/font.eot");
  ...
}