Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yansusanto/249773c9d30a3906958d8957210eadee to your computer and use it in GitHub Desktop.
Save yansusanto/249773c9d30a3906958d8957210eadee to your computer and use it in GitHub Desktop.

Install bootstrap

npm install react-bootstrap bootstrap

Install Sass

npm install node-sass gatsby-plugin-sass

Set up Bootstrap scss

  • Download source files from getbootstrap.com and copy the scss directory to src/scss/bootstrap
  • Configure gatsby-plugin-sass, specifying the bootstrap scss directory created in porevious step:
plugins: [
  {
   resolve: `gatsby-plugin-sass`,
   options: {
     includePaths: ["src/scss/bootstrap"],
   },
 },
]
  • create a src/components/layouts.scss file (or use another top level component) with the following sass:
/* import the necessary Bootstrap files */
@import "functions";
@import "variables";

/* put your custom stuff here */

/* finally, import Bootstrap */
@import "bootstrap"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment