You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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. test-b probably appears in the output cause it extends yet another hidden selector.
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!
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.
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.
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 @import (reference) call. Meaning, just the presence of an :extend seems to break the (reference) feature, and there's no way to "hide" the rulesets that use extend.
@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 2.5.3 of 2015-09-25).
Activity
matthew-dean commentedon Feb 16, 2014
Agreed.
(reference)is implied to be passive until "activated" by another call. I would classify this as a bug.donaldpipowitch commentedon Feb 17, 2014
Looks like this bug: #1851
SomMeri commentedon Feb 17, 2014
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.
test-bprobably appears in the output cause it extends yet another hidden selector.mark-casasoft commentedon Feb 20, 2014
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!
chharvey commentedon Feb 26, 2014
@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
fileB.css:This is what
div.box-blocklooks like:display: inline; (fileA.css:5)border: 1px solid black; (fileA.css:6)display: inline-block; (fileA.css:10)font-style: italic; (fileA.css:11)display: block; (fileA.css:14)font-weight: bold; (fileA.css:15)
display: inline; (fileB.css:5)border: 1px solid black; (fileB.css:6)
display: inline-block; (fileB.css:9)
font-style: italic; (fileB.css:10)
And this is what
div.box-blockshould look like:display: inline; (fileA.css:5)border: 1px solid black; (fileA.css:6)
display: inline-block; (fileA.css:10)font-style: italic; (fileA.css:11)
display: block; (fileA.css:14)
font-weight: bold; (fileA.css:15)
calvinjuarez commentedon Feb 27, 2014
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
main.less
main.css
LordZardeck commentedon Feb 27, 2014
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.
upgraded to Less 1.7.0
JLLeitschuh commentedon Jul 1, 2015
1+ Even if there was a work around that would be great.
hybopressthemes commentedon Jul 11, 2015
+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..
matthew-dean commentedon Sep 2, 2015
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
@import (reference)call. Meaning, just the presence of an:extendseems to break the(reference)feature, and there's no way to "hide" the rulesets that use extend.alexkrauss commentedon Sep 7, 2015
We are running into this in a highly modular setup, with particularly bad consequences:
foohas its own less filefoo.less@import (reference) '../base-styles'So, this is just to emphasize the importance of this issue :-).
Fixing import by reference
SomMeri commentedon Dec 7, 2015
This should be fixed by #2729 .
mohammed-softordi commentedon Jan 27, 2016
@SomMeri thanks you work, is this merge released? I am having the same problem with the latest release (2.5.1).
seven-phases-max commentedon Jan 27, 2016
@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
2.5.3of 2015-09-25).SomMeri commentedon Jan 27, 2016
@mohammed-softordi No it was not released yet. That pull request was finished last December while last release was in September.
mohammed-softordi commentedon Jan 27, 2016
@seven-phases-max @SomMeri thanks, it would be really great if you could release the fix but, no pressure :-)