-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Extend from @import (reference) #1878
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
Comments
Agreed. |
Looks like this bug: #1851 |
I think they are slightly different. In this case of referenced file extends something in main file. The other issue is a problem with chaining references, e.g. |
I have this exact same issue. When I have a file which is importing bootstrap by reference and the file is empty, I would expect no output yet due to the 'extend' keyword, all the files which use such an extend keyword (mostly to extend with the clearfix class), gets output as well! |
Exactly same issue! |
@markcsasar Similar to what's happening to me. It really screws with overridden properties. LESS:
What I actually get for the CSS:
Expected result for the CSS:
Now when I link
This is what
And this is what
|
For the sake of discussion, I'd like to ask, what would we expect from mixins defined in the referenced file that extend classes also within the referenced file? For example, given these LESS files, the I'd expect the output to look like that CSS there at the bottom. Any fix for this bug should preserve this behavior, IMO. prototype.less.prototype {
proporties: here;
.child {
child-proporties: here;
}
}
.extends-prototype() {
&:extend(.prototype);
& &-child { &:extend(.prototype .child); }
} main.less@import (reference) 'prototype.less';
.instance {
.extends-prototype();
} main.css.instance {
proporties: here;
}
.instance .instance-child {
child-proporties: here;
} |
I'm having the same issues here. If I try to import bootstrap by reference and don't actually have any less styles, I still get output, even though technically I shouldn't. Using less v1.7.0 and node v0.10.25. |
`@import (reference)` still not working! see [issue #1878 on less.js](less/less.js#1878)
1+ Even if there was a work around that would be great. |
+1 I am facing same issue. Please make it a priority, its been 1+ years since it was first reported here. As we use automation tools to generate css and also minify etc. So its passed onto users, and not only it adds extra bytes but also confuses users if they have a look at css files. (I know I can manually clean it up, but why should I, if I have already invested so much in automation). Hopefully it gets solved soon, or at-least provide hack until you fix it in core.. |
I just ran into a variant of this bug, in which a class that extended another class ended up in the resulting CSS, even though BOTH classes were behind an |
We are running into this in a highly modular setup, with particularly bad consequences:
So, this is just to emphasize the importance of this issue :-). |
This should be fixed by #2729 . |
@SomMeri thanks you work, is this merge released? I am having the same problem with the latest release (2.5.1). |
@mohammed-softordi You can find if the changes were released by comparing the PR merge date (Nov 20, 2015 in this case) to the releases date in the Changelog (the latest release is |
@mohammed-softordi No it was not released yet. That pull request was finished last December while last release was in September. |
@seven-phases-max @SomMeri thanks, it would be really great if you could release the fix but, no pressure :-) |
Selectors from file imported as (reference) can extend rulesets in the main file. I think that nothing from reference imported file should appear in the main file, unless main file asks for it (either by extend or mixin).
The file
import-as-reference-extend.less
contains one extend:and
main.less
imports it as reference:It is compiled into:
Expected result:
Tested on windowns node.js less-1.6.3.js
The text was updated successfully, but these errors were encountered: