Skip to content

Request - support for recursive variable definition #1545

Closed

Description

@sunyatasattva

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?

Activity

  1. lukeapage commented on Sep 13, 2013

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions