Dancer
Dancer

Reputation: 17651

Using Bootstrap with Less / Grunt / NOde

I am reasonably new to Grunt - I have less setup via grunt/node and would like to include the basic unstyled responsive backbone of Bootstrap - rather than the entire css/ js - is this possible - can anyone explain how as i've read various documentation and i'm mighty confused!

I have found this NPM library - https://www.npmjs.com/package/grunt-bootstrap which sound slike it could provide what i'm after but I have no idea what files would provide me with the basic responsive skeleton without all the styling - or what version of Boostrap the files relate to - can anyone advise please?

Upvotes: 0

Views: 391

Answers (1)

Bass Jobsen
Bass Jobsen

Reputation: 49044

You can download the Bootstrap's source code. Then run npm install, after that you can rebuild bootstrap by running the Grunt tasks.

You can disable the jquery Plugins in the Gruntfile.js by commenting them out. The same for your CSS code in the less/bootstrap.less file.

The less/bootstrap.less file already contains useful comments such as // Reset and dependencies and // Core CSS so it will be easier to find out what to use and what not.

To compile a very basic version that only contains the grid system you could use a less/bootstrap.less which contains:

// Core variables and mixins
@import "variables.less";
@import "mixins.less";

// Reset and dependencies
@import "normalize.less";
@import "print.less";

// Core CSS
@import "grid.less";

After changing the less/bootstrap.less as above you can run grunt dist-css. The preceding command compiles dist/css/bootstrap.min.css which can be used for your project.

Upvotes: 2

Related Questions