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

& selector creates new scope within same selector path #341

Open
twhoff opened this issue Mar 29, 2016 · 0 comments
Open

& selector creates new scope within same selector path #341

twhoff opened this issue Mar 29, 2016 · 0 comments

Comments

@twhoff
Copy link

twhoff commented Mar 29, 2016

Using the ampersand to create an anonymous scope within a selector in LESS4J creates duplicate selectors in the CSS output, where in Node LESS, the output is still grouped under a single selector. Duplication causes larger compiled files and seems to take more time to compile as well... could be an issue with how LESS4J handles scope?

Simple example:

.test {
    .test-mixin();
    & {
        @value: 2;
        value: @value;
    }
    value: @value;
}

.test-mixin() {
    @value: 1;
}

Compilation result:

// Node LESS - correct

.test {
  value: 2;
  value: 1;
}
// LESS4J - duplication

.test {
  value: 1;
}
.test {
  value: 2;
}
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

2 participants