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

Request - support for recursive variable definition #1545

Closed
sunyatasattva opened this issue Sep 13, 2013 · 1 comment
Closed

Request - support for recursive variable definition #1545

sunyatasattva opened this issue Sep 13, 2013 · 1 comment

Comments

@sunyatasattva
Copy link

Why doesn't LESS allow for recursive variable definition? As seen in:

var a = 1;
a = a + 1;

or in pseudo-LESS

@a: 1;
@a: @a + 1;

Does it have to do with the lazy loading system? And why would it be a bad idea to support this kind of syntax?

@lukeapage
Copy link
Member

Less is declarative, it doesn't run your css from start to finish. So the
variable declaration used is always the last in all files, not the last
going up from the current place.

You could make variables use different rules if they self reference, but I
think it gets very complicated and inconsistent.

What are you trying to do that you can't?

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