Compass

To achieve compass writing 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 I also tried the full path.

The structure looks like this:

+ web
  - sass
     + icons.scss
     + ...
  - images
     + icons
       - icon1.jpg
       - icon2.jpg
       - ...
+5
source share
2 answers

The 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

As config.rbyou should have something like:

...
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;

Since import refers to the directory imagesthat we defined above.

Remember to understand the configuration file, because it can be difficult http://compass-style.org/help/tutorials/configuration-reference/

+7
0

All Articles