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
{{ message }}
Repository navigation
Detached ruleset scopes affected — Recording an error reporting #2868
When I refer to the code in the manual for testing, I found the detached ruleset scopes affected.
( use webstorm and less 2.6.1)
View code,Please visit Less manual
Reads as follows
Variable and mixins accessible form definition win over those available in the caller:
@variable: global;
@detached-ruleset: {
// will use global variable, because it is accessible// from detached-ruleset definition
variable: @variable;
};
selector {
@detached-ruleset();
@variable: value; // variable defined in caller - will be ignored
}
compiles into:
selector{variable: global;}
If you add additional code in front of manual reference code,for example:
//additional code@testvalue: 2px;
#test {
width: @testvalue;
}
//manual reference code@variable: global;
@detached-ruleset: {
// will use global variable, because it is accessible// from detached-ruleset definition
variable: @variable;
};
selector {
@detached-ruleset();
@variable: value; // variable defined in caller - will be ignored
}
compiles into:
#test{width:2px;}selector{variable: value;}
The value of variable: global becomes value;
At present, I can not explain why.
I can only record as an error reporting.
Hi,
Although this issue was opened about 10 years ago, I can still reproduce this on the latest master branch with the example you provided.
I would like to work on a fix for this.
Activity
[-]Detached ruleset scopes affected —— Recording an error report[/-][+]Detached ruleset scopes affected — Recording an error reporting[/+]ShirayukiRin commentedon Aug 10, 2026
Hi,
Although this issue was opened about 10 years ago, I can still reproduce this on the latest master branch with the example you provided.
I would like to work on a fix for this.
fix less#2868: add tests for mixin lookup and nested definition scope…