Gatsby Sass

Building a blog with scss files

Gatsby Sass

by John Vincent


Posted on September 20, 2019


Using Scss files with Gatsby is straightforward.

Gatsby Sass Plugin

Using the plugin gatsby-plugin-sass, add to gatsby-config.js

`gatsby-plugin-sass`,
{
    resolve: `gatsby-source-filesystem`,
    options: {
        name: `scss`,
        path: `${__dirname}/src/styles`,
    },
},

Load Scss

Add to gatsby-browser.js

import './src/styles/styles.scss';