ericalli / static-site-boilerplate

A better workflow for building modern static websites.
http://staticsiteboilerplate.com
MIT License
1.73k stars 165 forks source link

How to import CSS libraries like Bootstrap? #12

Closed dmarman closed 5 years ago

dmarman commented 5 years ago

Any hint how could I import other CSS/JS libraries like Bootstrap?

ericalli commented 5 years ago

Sure, the steps below should do the trick:

Step 1: Install Bootstrap and dependancies via NPM

npm install --save bootstrap popper.js

Step 2: Import Bootstrap JavaScripts

Open the file src/javascripts/scripts.js

import 'bootstrap';

Step 3: Import Bootstrap Styles

Open the file src/stylesheets/styles.scss and add the following line to the top:

@import "~bootstrap/scss/bootstrap"; and add the following line to the top:

Let me know how that works out for you!