You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I define a variable, then redefine it later, LESS's compiler seems to use the latter variable definition as opposed to using the first until it's been redefined.
If I define @Variable1 in variables.less, then redefine it in phone.less, LESS uses phone.less's @Variable1 definition across the entire project, instead of using it as it's been defined in variables.less until its been redefined in phone.less
Here's a real world scenario:
Style.less
-> import variables.less : set @font-size: 16;
-> Import base.less: body{ font-size: @font-size_1px; }
-> import theme.less
-> import phone.less, set @font-size: 12; body{ font-size: @font-size_1px; }
In both base.less and phone.less, body's font size will be 12px, and not 16 and 12 respectively. Anyway we can rework this, or do I have to use different variables?
Hmm, I just read that and it seems we're having the opposite problems? They're saying that their variables are being redefined (which is what I want), but in my case they're not... Let me go back and look at my project and see if I'm doing something wrong.
But when I use CodeKit to compile my less, it returns this:
#test1{color:#444444;}
#test2{color:#444444;}
And then when I use less.js, it gives me the same output. For one, I think lesso is possibly using a different Less compiler. Either way, any thoughts?
Activity
dmcass commentedon Aug 16, 2012
Looks like this might be a duplicate of #297 perhaps?
nathanielks commentedon Aug 16, 2012
Hmm, I just read that and it seems we're having the opposite problems? They're saying that their variables are being redefined (which is what I want), but in my case they're not... Let me go back and look at my project and see if I'm doing something wrong.
nathanielks commentedon Aug 16, 2012
Ok, so this is weird. Here's the code I used lesso to test:
@red: #D14728;
#test1{
color: @red;
}
@red: #444;
#test2{
color: @red;
}
I used Lesso to test and it produces this output:
/* downloaded from http://www.below.ch/lesso/parse/23c8990f/1 */
#test1 { color:#d14728; }
#test2 { color:#444444; }
But when I use CodeKit to compile my less, it returns this:
#test1{color:#444444;}
#test2{color:#444444;}
And then when I use less.js, it gives me the same output. For one, I think lesso is possibly using a different Less compiler. Either way, any thoughts?
nathanielks commentedon Aug 16, 2012
From #297, lesso is using a different compiler
lukeapage commentedon Oct 25, 2012
just to be clear, is this issue this one
#297 (comment)
?