Jekyll Variable in SCSS Files

April 16, 2016

You can use Jekyll site variables in top-level SCSS files. For example:

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

These site variables will also visible in partials that are imported after it:

// _fonts.scss

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