Bootstrap 4 custom build generator / download

Yatko picture Yatko · Aug 17, 2017 · Viewed 31.5k times · Source

Does anyone know about an alpha/beta bootstrap 4 custom generator, same that is available for bootstrap 3 at Customize and download?

https://getbootstrap.com/docs/4.0/customize/ still unavailable

Answer

Klooven picture Klooven · Nov 12, 2017

As discussed here, there will not be a customizer for Bootstrap 4. This means that you'll need to set up build tools for yourself. This is my workflow (in NodeJS):

  1. Create a new project with npm init
  2. Install Bootstrap with npm install bootstrap
  3. Install build tools. To make this easy and only need to use one command, we'll use scss-powertools (I am the author of it). If you don't want to use it, you have to set up compiling, prefixing, minifying (and linting) yourself. Run: npm install scss-powertools --save-dev
  4. Create the SCSS file in a scss folder (in the root of your project), like scss/name.scss
  5. In the SCSS file import Bootstrap with @import "bootstrap/scss/bootstrap"; or import the individual components as you need them
  6. Add a new script to package.json: "build": "scss-powertools scss/name.scss output/compiled.css"
  7. Run npm run build, you will find your compiled CSS in output/compiled.css (or whatever you have specified as an option in the build command)

Notice! scss-powertools doesn't minify by default. To enable it use the --production flag. You can find all information about it here.

Simple setup can be found from this Gist.


You can find my previous workflow here. In it I had to set up everything from compilation to linting manually.