twitter-bootstrap 3.x, the easy way for customization

create an empty bootstrap.less inside your project that will import variables.less, then customize variables you want, then import bootstrap.less.

Less `@import` is an implicit « import once » (like the php `require_once`) , so the `@import variables.less` present in official bootstrap.less file will not reload the default variables.

This way allows you to update easier the twitter bootstrap library when you need.

@import "../twitter-bootstrap/less/variables.less"
@import "variables.less" // customize (or not) variables
@import "../twitter-bootstrap/less/mixins.less"
@import "mixins.less"

// in that file already imported .less will be not re-imported
// unless you explicitely ask it when compiling
@import "../twitter-bootstrap/less/bootstrap.less"
// Alternative : 
// instead of importing native bootstrap.less
// you can only take some importation

//== Custom
//## add your own specific rules here


Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée.