-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Duplicated nested mixin rule when @importing multiple times #884
Comments
so use import-once or don't import twice? |
I tried use import-once. But this issue cannot resolved. |
then why did import-once not work ? |
A more fundamental question is, what's the situation where you'd want to import something twice? It has never ever happened to me or anyone on our team. Why would you ever want to have the same thing defined twice? That doesn't make any sense, and causes major headaches when trying to debug. It was causing so many issues for us, because of the sheer number of .less files we're dealing with that we simply forked LESS and fixed it on our version so that @import IS @import-once (which, by the way, didn't actually work on trunk). |
Can I close this and leave discussion to #212 ? |
Yes. |
@agatronic Issue of #212 is closed but this bug is not fixed in 1.3.1. |
pull request #1010 has been pulled into 1.4.0 |
@agatronic hmm... I can't think that pull request not resolve this. |
because the file will only be imported once and not twice, so the rules will not be duplicated... why does it not clear your bug? What behaviour exactly is the problem or that isn't solved? |
@agatronic hoge-block.less .some_block {
color: red;
}
.some_block color:yellow .mixin-inner {
color: red;
}
.hoge_block {
color: blue;
}
.hoge_block color:yellow .mixin-inner {
color: red;
} I think that commit of cb78933 is not apply in nested rule (not ralete import once) and this issue isn't fixed. |
First, you're missing a semi-colon in the above example which is causing the weird selector output. After fixing that, your issue becomes more clear. Checked out 1.4.0 and tried it myself. hoge-block.css .some_block {
color: yellow;
color: red;
}
.some_block .mixin-inner {
color: red;
}
.some_block .mixin-inner {
color: red;
}
.hoge_block {
color: yellow;
color: blue;
}
.hoge_block .mixin-inner {
color: red;
}
.hoge_block .mixin-inner {
color: red;
} Essentially it looks like nested imports need to be addressed with the import once functionality.
|
FYI/PSA: Twitter-bootstrap 2.x users run into this when they @import bootstrap.less and responsive.less into a single .less file. (They're designed to be compiled separately, so each imports variables.less and mixins.less). |
Thank you for advice and pont mistake. I update issue |
ok, I see there is a bug in import once, thanks @dmcass. I have re-labelled this as a bug. |
Which again begs the question why there are two import methods, and why the On Nov 10, 2012, at 6:42, Luke Page [email protected] wrote: ok, I see there is a bug in import once, thanks — |
No, in the 1.4.0 branch and future release, the default behaviour has been changed to import-once |
Fabulous! Michael Heilemann On Nov 10, 2012, at 8:10, Luke Page [email protected] wrote: No, in the 1.4.0 branch and future release, the default behaviour has been — |
Has the duplicate issue/nested import issue (noted by @dmcass) been fixed as well with Will the bug only be fixed in 1.4.x or the next 1.3.2 release as well? |
not yet, its part of the major blockers for 1.3.2 (everything labelled paths) |
I have committed a fix for import-once so that it uses the full path to determine duplicates, not whatever path is used in |
@agatronic, thank you! Gotta say, this is the second issue I've brought up that you guys have fixed ASAP and I'm super thankful. Kudos and keep up the excellent work! |
This issue is like #49.
When import same file multiple times, I got result that has duplicated nested mixin rule (only nested mixin)
For example
_mixin.less
some-block.less
hoge-block.less
and result
some-block.less
hoge-block.less
but expected result
The text was updated successfully, but these errors were encountered: