2createStudio / postcss-sprites

Generate sprites from stylesheets.
MIT License
413 stars 50 forks source link

Sprite path with groupBy option #15

Closed jednano closed 9 years ago

jednano commented 9 years ago

If I use the following configuration options:

postcssSprites({
    stylesheetPath: './dist/css',
    spritePath: './dist/images/sprites/sprite.png',
    groupBy: image => {
        return image.path.split(sep).slice(-3, -2)[0];
    }
})

It names each sprite with a sprite prefix.

dist/images/sprites/sprite.foo.png
dist/images/sprites/sprite.bar.png
dist/images/sprites/sprite.baz.png

Is there any way to configure it in such a way that there is no sprite prefix? Like this?

dist/images/sprites/foo.png
dist/images/sprites/bar.png
dist/images/sprites/baz.png
vvasilev- commented 9 years ago

To achieve this you can use new skipPrefix option.