Bootstrap variable overriding with LESS -


i have been investigating whole day considered worthwhile spending time learn best practice customizing bootstrap.

i can see there friendly page available customizing elements selectively http://twitter.github.io/bootstrap/customize.html want have more control without touching original bootstrap source files.

to start with, wanted test out changing grid 12 16 columns , this, created own variable less file , added @gridcolumns:16; file , imported custom less inside bootstrap.less follows.

// core variables , mixins @import "variables.less"; // modify custom colors, font-sizes, etc @import "mixins.less"; **@import "../custom-variables.less"; //override variables** 

then, using winless compiled bootstrap.less file new bootstrap.css overridden variable import call , linked css html file grid won't change 16 columns.

can please point out doing wrong?

i work on similar project have bootstrap in 'third-party' location , override mixins.less , variables.less. pattern use adds 3 files , doesn't touch bootstrap @ (allowing drop in replacements easily):

/style |- bootstrap-master/ |    |- less/ |    |- js/ |   ... |- shared/     |- shared.less     |- variables.less     |- mixins.less 

the mixins file

/*  *    /style/shared/mixins.less  */  @import "../bootstrap-master/less/mixins.less"; // override mixins (or add of third party mixins here) 

the variables file, override grids

/*  *    /style/shared/variables.less  */  @import "../bootstrap-master/less/variables.less";  @gridcolumns: 16; // let's pretend site-specific override 

the file imported (or fed through less compiler):

/*  *    /style/shared/shared.less  */  @import "variables.less"; @import "mixins.less";  @import "../bootstrap-master/less/grid.less"; //and other bootstrap less files need here 

in setup, if this, css file weird .span15 values (since didn't update @gridcolumnwidth or @gridgutterwidth .row-fluid values work out way you'd expect them since they're calculated straightforward division).

i setup because can cd bootstrap-master , git pull , fetch new updates without having merge of specific kludges (it gives me handle on i've overridden)

the other thing it's clear shared.less using grid.less (rather of bootstrap). intentional since in instances don't need of bootstrap, few parts of going. bootstrap less files @ least nice in hard dependencies shared.less , mixins.less

if still isn't working, maybe winless getting confused


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -