php - Overriding Bootstrap LESS variables after @import -


i trying override bootstrap less variables before compiling e.g.

// core variables @import "variables.less";  // trying override @white variables.less @white: #de1de1;  // other bootstrap @imports.... 

the above code doesn't override @white, if add @white @ end of variables.less file, works fine.

it appear variables can overwritten in same file. doesnt make sense me, assumed less didnt work that. example other @import files (omitted code above) use @white variable. if able use outside variables.less file, why can't override outside file?

i'm using less php 0.3.9 compile code.

note: i've tried following code:

// core variables @import "variables.less"; @import "variables-custom.less"; 

now value of @white taken variables-custom.less (which solves problem). still doesn't explain why original code doesn't work though. appreciate answers on that.

variables overwritten (and available) in order have imports set compile.

for example:

@import "variables.less";   //@white set @import "styles.less";        //updated @white not available @import "variables-custom.less";   //update @white @import "styles2.less";        //updated @white available 

so, make sure if not going use variables.less rather variables-custom.less, put before of other .less file (except variables.less of course).


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -