svg-sprite / grunt-svg-sprite

SVG sprites & stacks galore — Grunt plugin wrapping around svg-sprite that reads in a bunch of SVG files, optimizes them and creates SVG sprites and CSS resources in various flavours

Home Page:https://github.com/svg-sprite/svg-sprite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make prefix and placeholder configurable

stefanjudis opened this issue · comments

Hello Joshi,

currently the generated .scss file uses always the 'svg-' prefix.

I'm planning to run this task for multiple sprite generation, so I'd like to set this prefix somehow.

Giving it the name of the generated file would also work fine.

Current:

%svg {
    background-image:url(svg/sprite.svg);
    background-repeat:no-repeat
}
.svg-acucar,
.svg-acucar\:regular {
    @extend %svg;
    background-position: 0 0;
}
.svg-acucar-dims {
    width: 70px;
    height: 70px;
}

Desired in _ingredients.scss:

%ingredients {
    background-image:url(svg/ingredients.svg);
    background-repeat:no-repeat
}
.ingredients-acucar,
.ingredients-acucar\:regular {
    @extend %svg;
    background-position: 0 0;
}
.ingredients-acucar-dims {
    width: 70px;
    height: 70px;
}

This is what the --prefix option is about (defaulting to svg). Doesn't this work for you?

Aaahhhhh shit... sorry.

I didn't check options of svg-sprite properly...

No problem. ;)