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

Parent selectors (in mixins) are ignored in referenced files #1646

Closed
nsdcss opened this issue Nov 8, 2013 · 2 comments
Closed

Parent selectors (in mixins) are ignored in referenced files #1646

nsdcss opened this issue Nov 8, 2013 · 2 comments

Comments

@nsdcss
Copy link

nsdcss commented Nov 8, 2013

Hi, I am playing around with the new @import (reference) ... feature and encountered a strange behavior.

If I am using the parent selector "&" inside a mixin that is located in a file that is imported with the (reference) statement (and then call the mixin from another file) all the parent-selectors are ignored.

So if I have this in the mixin:

a {
  color: #f00;
  &:hover {
    color: #0f0;  
  }
}

This is what comes out:

a {
  color: #f00;
}

Beside that the reference feature is really great. Thank you for that.

@seven-phases-max
Copy link
Member

Wasn't it fixed in 1.5.1? At least I can't reproduce this with current master. Well, the above example is a bit awkward since a can't be a mixin, but if I compile something like this:

// other.less:
.a {
    color: #f00;
    &:hover {
        color: #0f0;  
    }
} 

// this.less:
@import (reference) "other";

z {.a}

it works as expected.

@seven-phases-max
Copy link
Member

Ok, closing due to inactivity (not reproducable with Less 1.5 and later).

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