Detached ruleset unlocked from namespaced mixin does not see its namespace scope
Open
Nobody has claimed this yet.
bug
medium priority
- Dominant language
- JavaScript
- Stars
- 17k
- Forks
- 3.4k
- Avg merge
- 7h 42m
- Merged PRs (30d)
- 26
Description
I defined a detached ruleset inside a namespaced mixin. The ruleset is unable to see variables defined in its outer namespace.
Less:
#namespace {
@variable: in-namespace;
.unlocker {
@detached-ruleset: { property: @variable; };
}
}
#namespace > .unlocker();
#detached-ruleset {
@detached-ruleset();
}
actual output:
NameError: variable @variable is undefined in test.less on line 4, column 36:
3 .unlocker {
4 @detached-ruleset: { property: @variable; };
5 }
expected output:
#detached-ruleset {
property: in-namespace;
}
Edit: I use node.js with lessc 1.7.0 (LESS Compiler) [JavaScript]
Edit 2: this issue is probably related to #2039
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the minimal Less example with lessc, using the namespaced mixin and detached ruleset shown in the report. Trace how the detached ruleset is unlocked and resolve its namespace scope; done means the output contains property: in-namespace instead of the undefined-variable error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript, node.js
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100