-
Notifications
You must be signed in to change notification settings - Fork 9
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
SCSSPHP not finding imports #2
Comments
Your change with the file_get_contents() won't work. $file is a CakePHP File object where ->read() is the contents of the file, so that part should be working fine (it was for me). One of my tests were including files earlier and it worked fine, however they were in the same directory. It looks like your import files are in the "compass" directory. Try going back to my commit earlier (where I added scssphp support) and add in another import path: http://leafo.net/scssphp/docs/#import_paths So you should have something like: $scss = new scssc();
$scss->setImportPaths(array($file->Folder->path, 'path/to/directory/compass'));
$code = $scss->compile($file->read()); I think thats all the issue is. Just try playing with that path to the compass directory. If that works perhaps I should add a shrink option to pass in an array of import paths to append. |
Also be sure you have debug in core.php at 1 or higher to watch for any errors. |
Still can't get it to work using:
and dumping that out gives: But that been said, should you need to do all that? When I tried this with the Less version it imported all the files automatically fine without any extra manual work :) Thanks. |
What happens if you do: debug($file->read()); Since scssphp wants only the contents of the file and not the file path you will likely have to set at least one import path (the location of the file). What you might could do to possibly avoid setting the import stuff is to change the compile() to somethink like: $code = $scss->compile('@import "'. $file->path .'"'); Then maybe it can see the full path to the file and not need to set extra imports. |
The debug gives me:
and trying that second line you posted doesn't make the import work either :( |
Hi me again :)
I've download the latest version of shrink to test the inclusion of Scssphp to do the compiling of Sass files via PHP instead of Ruby.
It works fine for single files but not for imports.
e.g.
If I pass it a file with JUST the following inside:
@import "compass/utilities";
@import "compass/typography";
@import "compass/css3";
The returned code will be empty.
To test this further I amended the code like so:
and I get the following errors:
So I'm wondering is the plugin struggling to find the files? Or this error just because of my test? Either way the imports are not working :) Any ideas?
Thanks once again.
The text was updated successfully, but these errors were encountered: