How to insert new image into COMPASS project

Asked

Viewed 45 times

6

I have the images I use in my project and I want to add a new image to use on the site, but I can’t get the image to be added to the sprites generated by COMPASS

  • Hunting subject just got done... 1 - In the ICONS folder add the image you want to add to the project; 2 - In the images folder (before ICONS) delete the Sprite generated by COMPASS for your project; 3 - Recompile the files the image will automatically generate in the correct location Ready, just use the added image

1 answer

1

To do Save with Compass we need to isolate the images that we want to merge into a folder, which will be called Sprite and will be inside the images folder. We need to warn Compass that whenever there is a . png file in the folder, it needs to be updated. For that, we’ll go to your main.scss and add a line that says so:

@import 'sprite/*.png'

See that after saving the terminal will respond

create imagens/sprite-s1e1f3a7a9e.png

He communicates that the Compass has created an Sprite with that name And after doing and undoing this small change to your main.scss, just so Compass can detect a change and Compile again, you can check the result in the images folder.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.