asciidisco / grunt-imagine

Grunt tasks for optimizing & inlining images
MIT License
153 stars 21 forks source link

Sprites uses path relative to the grunt root rather than to the CSS output. #34

Closed LaurentGoderre closed 11 years ago

LaurentGoderre commented 11 years ago

For flexibility, the background: url() should be relative to the CSS file not the grunt root.

For example:

sprites:{
    all:{
        src: ["src/plugins/sprites/**/*.png"],
    css: "src/base/partials/_sprites.scss",
    map: "src/base/partials/sprites/sprites.png"
    }
}

Results in

%_sprites_scss {
    background: url("../src/base/partials/sprites/sprites.png") no-repeat;
 }

Instead of

%_sprites_scss {
    background: url("sprites/sprites.png") no-repeat;
 }
LaurentGoderre commented 11 years ago

Let me know when it gets published to npm

alpadev commented 11 years ago

Just tried to npm ERR! publish Error uploading package npm ERR! Error: forbidden user: alpadev not authorized to modify grunt-imagine

Looks like you have to wait for @asciidisco but the release is already packed :)

LaurentGoderre commented 11 years ago

No rush :)