Skip to content

Mixin included in a class / referenced file outputs CSS regardless #1885

Closed
@mikedidthis

Description

@mikedidthis

Firstly thank you for continuing the effort with less.js!

I seem to be struggling with mixins inside a class pulled from a reference file.

Reference File

@import (reference) "base/_buttons";

.button-small {
    background: red;
    border-radius: 3px;
    .font-size(16,24):
}

Usage

.pages li a {
    &:extend( .button-small );
}

Output

.button-small,
.pages li a {
    font-size: 16px;
    line-height: 24px;
}
.pages li a {
    background: red;
    border-radius: 3px;
}

I expect the rules would be broken over two groups of properties. However, I didn't expect .button-small to be included.

If I don't reference .button-small at all, the output is as follows:

Output

.button-small {
    font-size: 16px;
    line-height: 24px;
}

Am I doing something wrong? Are reference files for styles only? Is this a bug?

Any help would be appreciated.

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