Skip to content

difference between a imported namespace and a declared one #1895

@bassjobsen

Description

@bassjobsen

this code work well:

#ns {
.nsmixin(@color){
color: @color;
}
}

.mixin()
{
.test2 {
        #ns > .nsmixin(blue);
}
}
.mixin();

Then i create a file ns.less which contains:

.nsmixin(@color){
color: @color;
}

now the code below shows an error:

#ns { @import "ns.less";}

.mixin()
{
.test2 {
        #ns > .nsmixin(blue);
}
}
.mixin()

error: "SyntaxError: #ns > .nsmixin is undefined" this only happens when its wrapped inside a mixin. Use the namespace in a class works well too:

   #ns { @import "ns.less";}
   .test2 {
        #ns > .nsmixin(blue);
    }

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