-
Notifications
You must be signed in to change notification settings - Fork 461
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
Compass-style import once behavior #583
Conversation
This is recursive across all @import directives, so if the dependency is deep, it will only be imported when seen first.
Conflicts: context.cpp context.hpp emscripten_wrapper.cpp emscripten_wrapper.hpp
Well, building it yourself is definitely a damn fine way of registering a strong protest. ;) I for one rather like this, but I know that @nex3 wants a more robust system for sass long term. We could make a libsass-compass project that adds in functions like this. There are a couple of those, including path handling (image_path, etc) and spriting, etc. But, I'd also like to point out that you can emulate this behaviour in pure sass too! Foundation does it that way with a map in its export() function. https://github.com/hcatlin/foundation/blob/29ffaad25daa4cfd99f5c9da4143baf89d883565/scss/foundation/_functions.scss |
Heh, I didn't mean it as a protest, only that it was something we needed and found useful :) And wow, that's quite a neat trick for import-once emulation! I totally understand the desire for a more robust system, any thoughts to what that would look like? Also, is there any mechanism/plan/roadmap for the ability to add additional plugins/behaviors to libsass? |
Check this out: https://gist.github.com/nex3/81c8a64f29771803916a |
I've just added sassc bindings for enabling this behavior: sass/sassc#78 |
Interesting, I'm planning on building this into my libsass implementation. I feel like file I/O could be better handled by impmentation rather than libsass directly. File watcher for instance would be better handled by the libsass implementation. |
As discussed on twitter this belongs in custom importer until modules lands in Sass next. |
This adds commpass-style import-once behavior to libsass, without the exclamation point suffix override.
Though this was a closed issue in #450, we depended on this functionality and using ruby sass was simply not performant enough for our needs.