Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected DR scope visibility results #3075

Closed
printjs opened this issue May 23, 2017 · 5 comments
Closed

Unexpected DR scope visibility results #3075

printjs opened this issue May 23, 2017 · 5 comments

Comments

@printjs
Copy link

printjs commented May 23, 2017

Official document

source

@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
}

result

selector {
  variable: global;
}

actuality

source

@variable: #abc;
@detached-ruleset-test: {
  color: @variable; 
};
.selector {
  @detached-ruleset-test();
  @variable: #def;
}

result

.selector {
  color: #def;
}

less version is 2.7.2

@rjgotten
Copy link
Contributor

rjgotten commented May 23, 2017

Afaik detached rulesets are supposed to pull both caller and definition scope into closure and give precedence to caller scope. So; not a bug, but definitely weird behavior. Hopefully it will be removed sometime in the future.

@seven-phases-max
Copy link
Member

seven-phases-max commented May 23, 2017

I can't reproduce your "actuality" results in v2.7.2 so more details needed.

@rjgotten

and give precedence to caller scope.

No, neither DRs nor mixins (unless defined/invoked with parametric namespace) ever did this. (You'll find the mixins scope priority list here).

@seven-phases-max seven-phases-max changed the title I think this situation is BUG Unexpected DR scope visibility results May 23, 2017
@rjgotten
Copy link
Contributor

rjgotten commented May 23, 2017

No, neither DRs nor mixins (unless defined/invoked with parametric namespace) ever did this

I thought this was actually reported before in another issue and was deemed expected behavior back then?
Perhaps I'm mixing something up.

@seven-phases-max
Copy link
Member

Perhaps I'm mixing something up.

Most likely, because it's just how it works and has been working always. So @wjtgithub's problem is elsewhere.

@stale
Copy link

stale bot commented Nov 14, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 14, 2017
@stale stale bot closed this as completed Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants