Bootstrap 4 custom build generator / download [duplicate]

As discussed here on Stack Overflow, there will not be a customizer for Bootstrap 4. This means that you’ll have to build the Sass files manually. This can be achieved with the sass npm package, for example.

I’ve also created a tool that handles compiling the Sass and vendor prefixing, which I’ve been using to compile Bootstrap. This is a simple setup to get started with:

npm i bootstrap@4 sass-plus -D

Create a file called app.scss and import Bootstrap in there:

@import "bootstrap/scss/bootstrap";

Compile it:

npx sass-plus -i app.scss -o compiled.css

You should now find all of the Bootstrap-classes in compiled.css. You can make changes to the app.scss file and recompile and the changes will be reflected in the CSS, that can be referenced normally in HTML.

By importing Bootstrap components individually and changing Bootstrap’s variables you can change the look of your site and the size of the compiled CSS.

Resources:

Leave a Comment