Open Bilge opened 2 years ago
I have a different opinion, it's not a bug.
@color: red;
a {
color: @color;
}
.foo {
a:extend(a all){
@w: 10px;
@color: green;
width: @w;
color: @color;
}
}
It become
// first part
a,
.foo a {
color: red;
}
// second part
.foo a {
width: 10px;
color: green;
}
First part is public section, the variable you declare the second time can't affect the first part.
You are correct. Even without extension, this does not work. I misunderstood from lazy evaluation that declaring a variable after the property that consumes it will update the property if it exists in the same scope or deeper, however that appears not to be the case.
It seems to me lazy evaluation is not really lazy at all. Once a property is declared referencing some variable, that variable has to exist (even if it's physically specified later in the file) in the current scope, and if it is redeclared at any point later, this change is ignored.
To reproduce:
Current behavior:
.foo a
colour is red.Expected behavior:
.foo a
colour is green.Environment information:
less
version: 4.1.2nodejs
version: v14.15.3operating system
: windows