Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compass (grunt-contrib-compass) sprites paths problems

Tags:

gruntjs

Im using the grunt-contrib-compass pluckin, and I just cant get it to behave the way i want, the problem is that the image path in my css file are wrong.

Have been playing around with the parameters but i cant figure it out (sadface)

My folders:

/root
   /assets
       /css
       /images
           /sprites <-- generated images

And the configuration in my gruntfile.js

compass: {
        dist: {
            options: {
                 sassDir: 'src/scss'
                ,cssDir: 'assets/css'
                ,raw: 'preferred_syntax = :sass\n' 

                ,imagesDir:             "assets/images/"
                //,imagesPath:          "assets/images/sprites/"
                ,generatedImagesDir:    "assets/images/sprites/"
                ,generatedImagesPath:   "assets/images/sprites/"

            }
        }
    }

The image url in my css file:

/assets/images/sprites/interface-s04f47928b4.png

But it should really be:

../images/sprites/interface-s04f47928b4.png
like image 930
winthers Avatar asked Dec 03 '25 23:12

winthers


1 Answers

so i figured it out (finaly)

,imagesDir:             "assets/images/"
,generatedImagesDir:    "assets/images/sprites/"
,generatedImagesPath:   "assets/images/sprites/"
,httpGeneratedImagesPath: "../images/sprites"
like image 171
winthers Avatar answered Dec 09 '25 08:12

winthers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!