To compile .scss files in multiple directories we need to use "add_import_path" (http://compass-style.org/help/tutorials/configuration-reference/), but i dont get how.
I've tried to add
additional_import_paths
add_import_path "_themes"
add_import_path = "_themes"
additional_import_paths = "_themes"
in my config.rb, but no luck, Compass compiling only from sass_dir = "_modules"
Update: Yes, this line
add_import_path "_themes"
doesnt gives us "no folder found" error, but compass still not compiling .scss in it
What am i doing wrong?
There's an accepted answer here, but I don't think it answers the question, but gives an alternate solution. Which is absolutely fine and I'm not trying to insult anyone, but what's not here is information on
add_import_path
and what it does for you.If anyone's ever worked in Magento, you're familiar with it's fallback structure for theming and template files. For setting up multiple stores that utilized the same default skin, we needed to include a fallback structure which would allow for changes over a pre-defined hierarchy. So check dis config.rb file
myThemeA - config.rb
myThemeB - config.rb
So the idea here is that we have three skins and we can use import paths to only override certain files instead of including EVERY file in EVERY skin. Which also mean, when we want to make global changes, depending on what we change, we don't have the make the change 3 times--only to where it's dependency would lay in the chain.
So...
default is the base of all skins
myThemeA is the skin by itself and uses default as it's default
myThemeB uses myThemeA as it's default, while myThemeA uses default as it's default.
What makes this work is the placement of
add_import_path
andadditional_import_paths
. Essentially, it uses theadd_import_path
defined first as the default and then the subsequentadditional_import_paths
array will override what was inadd_import_path
, but anything that wasn't included in the additional, it will go look for in the default.Hope this makes sense to anyone looking for more info on import paths.
To compile multiple
.scss
files you should import the "child" files into the "parent" SASS file using@import "filename";
.For example if you have main.scss, you might want to import more CSS from a child stylesheet called for example child.scss like this:
From what I understand, all that
add_import_path
does is allow you to import files from an additional directory. So you can also@import
from_themes/
See this thread.