Hi,
the @import command does only work, when u use the whole path to the file to import. My .scss file to import is in the same directory like the importing one.
@import "importme.scss";
results in:
SassException: Unable to find import file: importme.scss in SassFile::getFile() (Zeile 98 von /[...]/sites/all/modules/sass/phamlp/sass/SassFile.php).
@import "sites/all/themes/theme/css/importme.scss";
is working :-/
Is it possible to tell Sass to look into the same directory for the importing file?
Thank you :)
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | parse_all_scss_files-1304090-1.patch | 879 bytes | axe312 |
Comments
Comment #1
axe312 commentedWrong patch! This one does not fix the problem. Just uploaded to the wrong Issue! .. sry
Comment #2
derekwebb1 commentedSubscribing - same issue
Comment #3
anton-zaytsev commentedThank you for patch!
Just implemented it, expect to see the changes in version 2.01, after drupal.org crawler creates package.
Please let me know if new version wouldn't appears within 24 hours.
Comment #4
axe312 commentedThe patch @ #1 was not for this issue. The patch does not fix the problem. I just uploaded the patch to the wrong issue.
#1 was for http://drupal.org/node/1304104
Sry for that!
Comment #5
axe312 commentedI got the solution, but there's a bug in the SassFile.php of PHamlP ... so at this moment I cant fix it :(
Just add:
$SassParser_config['template_location'] = dirname($stylesheet);Before:
$sass_parser = new SassParser($SassParser_config);It should work now, but it does'nt :-/
The problem is this line in the SassFile.php of PHamlP:
if (!empty($parser->template_location)) {This if-strukture will allways fail, because there's a "bug" with the empty() function. Check this out:
http://www.php.net/manual/de/function.empty.php#101988
What to do next? Contact the Author of PHamlP?
Ps.: Iam using the version linked on the sass module page
Comment #6
anton-zaytsev commentedha, just wanted to write that I found solution and found your last post :)
but my solution a little bit different.
I added this line
after loop starts
need to use key "load_paths" as it is created specially for @import directive
Unfortunatly we can't use "load_paths" and "extensions" keys both at this moment, because of the bug in phamlp lib, file SassParser.php line 303-308, if rewrites it to
than @import directive will works as needed.
Comment #7
anton-zaytsev commentedadded new version 2.02, where @import has relative to current styles file include path
Comment #8
eu.claudio commentedWhere can I find such version?
Comment #9
axe312 commented@eu.claudio: U can get 7.x-2.2 via git!
Anton what should we do now? Contact the creators of phaml lib?
Comment #10
zymphonies-dev commentedfirst you can create .scss file which you want to import. for that file name start _(underscore)
example: _mixins.scss
and import this file in main .scss file
@import "mixins";
Thanks,
Comment #11
agn commentedsame issue on Drupal 6.26 (6.x)
Comment #12
illmatix commentedSo when is version 2.02 coming out? This issue looks 3 months old right now.