-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Allow for Dynamic @import Calls #210
Comments
closing: explanation here: Compass/compass#613 |
I understand what you've written there, but don't see how the implementation of this becomes "annoying and slow". The declaration of the variable |
as things stand right now, we have to parse a file into an abstract syntax tree (AST) to find the imports. Unlike CSS, imports can be anywhere -- including a scoped context -- so variables might have been computed, changed, etc. So the only way to know what imports that exist in this case is to go another step further by doing a |
Is there an efficient way to traverse the AST, looking for the value of this variable? No CSS compilation should be required. |
no, there's not. as I pointed out the value of variable can be changed during the execution. The only way to know the value is to run the scripts. |
Ok. So it's laggy and slow because you have to compile part of the script to find this value? Can you cache the resulting CSS from the partial compile and concatenate the rest once the proper file has been imported? |
yes. that's what I meant by annoying. I never said it was impossible. |
Got it. So this is on the back-burner until you can find a not so annoying way of implementing this? Can you leverage the Sass Cache? |
It's not on our list of planned features. |
Ok! I'll take that as a "shut down". |
I think you'll find a way to achieve your desired effect without this feature by looking at the problem from a different angle. If you can't send an email to the list with what you're trying to accomplish and we'll brainstorm how. |
See #739 |
I cannot seem to use variables when using the
@import
command. I have 2 different styles (white & red) that I want to choose from. As I understand it, this is a Sass issue. At the moment, I have:screen.scss
:main.scss
:partials/_identity.scss
:partials/_search.scss
:And I get this error when running
compass compile
:It doesn't look like the variable is being properly concatenated. I tried interpolation (
@import "identities/cu-#{$banner_color}
) but that fails too...Any reason this doesn't work?
The text was updated successfully, but these errors were encountered: