Skip to content

Variables are not overwritten properly #506

@FMCorz

Description

@FMCorz

I found out that defining the variables were not always set to their last assigned value.

To reproduce:

// main.less
@import variables.less
@textColor: #f90;
@import final.less;
@linkColor: #000;

// variables.less
@linkColor: #fff;
@textColor: #fff;

// final.less
@linkColor: #f90;

Expected

@linkColor is #000;
@textColor is #f90;

Actual

@linkColor is #f90;
@textColor is #fff;

When defining a variable twice, the last definition of the variable is used, searching from the current scope upwards. This is similar to css itself where the last property inside a definition is used to determine the value.

Thanks,
Fred

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions