In order to achieve spriting by compass according to the documentation I wrote this:
// web/sass/icons.scss
@import "../images/icons/*.jpg"; // for any cases also tried .png
@include all-icons-sprites;
and got the error:
error sass/icons.scss (Line 2: File to import not found or unreadable: ../images/icons/*.jpg.
I don't think the path is wrong because also tried full path.
The structure is like this:
+ web
- sass
+ icons.scss
+ ...
- images
+ icons
- icon1.jpg
- icon2.jpg
- ...
Compass for sprites uses the paths defined in config.rb
.
So if you have this structure:
+ web
+ sass
- icons.scss
+ images
+ icons
- icon1.png
+ config.rb
In your config.rb
you should have something similar to this:
...
images_dir = "images"
sass_dir = "sass"
...
Then in your icons.scss you should do this:
// web/sass/icons.scss
@import "icons/*.png"; // for any cases also tried .png
@include all-icons-sprites;
Because the import is relative to the images
directory we defined above.
Be sure to understand the configuration file, because it may be tricky http://compass-style.org/help/tutorials/configuration-reference/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With