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
This is just how extend works currently. It is questionabe if .test-b should appear in the output (i.e. ideally it may not output however there's also no reason why it must not), but the whole snippet looks more like "trying to use (reference) as a hack to achieve #1177".
Ah., sorry, my bad. I did miss that with the one level @import it actually supresses the output of the extended class (I was under impression that I have tried this as #1177 workaround before and it did not work... But aparently my test was somewhat wrong :)
I would create a test case, then debug extend visitor, look at where it creates the new selector and make sure its referenced field is only set to true if the extend is referenced (which it wont be if ibside a refrenced import).
but not entirely sure, its been a while sjnce working on those features.
But that left other issues with mixins in the referenced files un-fixed; mixins called from the main file (#1979) and mixins with nested selectors (#1968). Probably this rules should get the referenced state of the caller instead of that from the mixin.
Activity
seven-phases-max commentedon Feb 5, 2014
This is just how
extendworks currently. It is questionabe if.test-bshould appear in the output (i.e. ideally it may not output however there's also no reason why it must not), but the whole snippet looks more like "trying to use(reference)as a hack to achieve #1177".lukeapage commentedon Feb 5, 2014
I think its a bug, but would need to work out what's causing it to be sure.
seven-phases-max commentedon Feb 5, 2014
Ah., sorry, my bad. I did miss that with the one level
@importit actually supresses the output of the extended class (I was under impression that I have tried this as #1177 workaround before and it did not work... But aparently my test was somewhat wrong :)SomMeri commentedon Feb 17, 2014
I think that the expected output in the above should be:
donaldpipowitch commentedon Feb 17, 2014
You're right. That is a typo in my example. I will fix this.
bassjobsen commentedon Mar 2, 2014
as far as i understood, the problem also occurs without nesting:
@import (reference) "testextend.less";with testextend.less contains:
will be compiled into:
Where i expected no output at all. Tested with 1.6.3 and 1.7.0
4 remaining items
lukeapage commentedon Nov 3, 2014
I would create a test case, then debug extend visitor, look at where it creates the new selector and make sure its referenced field is only set to true if the extend is referenced (which it wont be if ibside a refrenced import).
but not entirely sure, its been a while sjnce working on those features.
donaldpipowitch commentedon Nov 3, 2014
Thank you for the effort.
bassjobsen commentedon Nov 3, 2014
i wonder if this issue can be fixed by using the following lines of code in parser/parser.js:
The above than should replace the lines:
lukeapage commentedon Nov 4, 2014
No, because that would stop you extending the result of an extend through a
reference.
bassjobsen commentedon Nov 4, 2014
Well, i see. Thanks.
It seems possible to fix this issue in the to-css-vistor.js inn the filter function:
But that left other issues with mixins in the referenced files un-fixed; mixins called from the main file (#1979) and mixins with nested selectors (#1968). Probably this rules should get the referenced state of the caller instead of that from the mixin.
assadtony commentedon Apr 28, 2015
Any updates on this issue? :)
Fixing import by reference
SomMeri commentedon Dec 7, 2015
This should be fixed by #2729 .
donaldpipowitch commentedon Dec 7, 2015
Just wow!
SomMeri commentedon Jan 31, 2016
Re-opening, because it now compiles into
instead of
matthew-dean commentedon Jan 31, 2016
Okay, if you get a fix for it, we can do a bugfix release soon.