Wolter
Wolter

Reputation: 1053

Bootstrap. less to css

I use twitter bootstrap. In my dev server I connect two less files: bootstrap.less and style.less:

@import "bootstrap.less";
@gridGutterWidth: 30px;

body {...}

I redefined some bootstrap variables in my style.less. How to convert bootstrap.less and style.less to css in this case?

Upvotes: 0

Views: 3418

Answers (2)

Marcin Skórzewski
Marcin Skórzewski

Reputation: 2854

Twitter Bootstrap team has developed its own tool for CSS - recess. It compiles LESS, optimizes CSS, lints and converts it according to BS's style guidance. It is available as Node package, install it with npm:

npm install recess

You can run it from command-line with:

recess --compile bootstrap.less > bootstrap.css

But preferred way is to use Bootstraps Makefile by running make bootstrap in Bootstrap's folder.

Upvotes: 6

Ryan McDonough
Ryan McDonough

Reputation: 10012

You can either use a tool such as SimpLESS to create the CSS then reference the CSS in your layouts, or you can use Less.js which converts to CSS on the fly, allowing you to still reference your LESS files in the code.

Upvotes: 2

Related Questions