-
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
Import Each Less File Only Once #212
Comments
I would like this feature request too. SASS wont compile .scss files start with '_' such like _config.scss. |
@import-once is implemented |
Import once test fails, are we sure this is resolved? |
its implemented and there is another bug about it not working, now it is implemented. I'm just trying to sort the wood from the trees - don't worry I'd like to see this working too. |
Cool, thanks for stepping up! One thing I wondered though is if a non "import-once" is ever needed. Seems like all imports should be "import-once" so wondering if the extra command is even necessary. |
So is this implemented or not? Can't find it in the docs.. |
I strongly agree - importing once should be the default, since I can't come up with a reason you'd ever want to import multiple. |
+1 There shouldn't be any need for @import-once. It should be the default behavior of @import. @cloudhead, what do you think? |
+1 for importing once being the default behaviour. |
reopened to track |
+1 for import-once being the default import behavior |
+1 @import-once is not needed nor should be present, since @import should result in a single import. |
👍 |
👍 |
2 similar comments
👍 |
👍 |
ok, you all win! I've changed this to high priority so its on my list of things to do when I get a chance. unless anyone wants to make a pull request? |
sorry for the multiple mentions, i edited my commit message a few times. @agatronic will pull request #1010 work? |
- Add @import-multiple if for some insane reason you want multiple imports. - Continue to support @import-once for backwards compatibility. - Fixes #212.
- Add @import-multiple if for some insane reason you want multiple imports. - Continue to support @import-once for backwards compatibility. - Fixes #212.
- Add @import-multiple if for some insane reason you want multiple imports. - Continue to support @import-once for backwards compatibility. - Fixes #212.
This is somewhat a duplicate of issue #49, however I did not find any clarification on what the best strategy was. Also, I should mention that I'm doing all of my compiling on the server side using node.
Here is my problem.
home.less:
@import "config";
@import "reset";
@import "core";
@import "base";
How I would like this to work is that it's like I'm specifying all of my dependencies at the top of my less file, and it will get compiled down into one nice css file.
However, what you get instead is:
-- config.css
-- reset.css
-- config.css
-- core.css
-- config.css
-- core.css
-- base.css
-- home.css
Basically, everyone depends on "config", because that's where all my colors and functions are located, and it would be nice if that was only loaded only once. Notice, in my specific case "core" gets loaded twice as well.
Is there a workaround, a hack, an alternative, or a fork that deals with this scenario. I feel like it's valuable from the standpoint that you could have css files like the following:
home.css
index.css
posts.css
blogs.css
And these would more or less dynamically create themselves with only the necessary css components based upon the imports you specify.
Cheers.
The text was updated successfully, but these errors were encountered: