drdk / grunt-dr-svg-sprites

Grunt plugin to create SVG sprites with PNG fallbacks at needed sizes
113 stars 19 forks source link

Invalid CSS file if sprite path doesn't have any svg file #50

Closed pomek closed 8 years ago

pomek commented 8 years ago

Hi,

I will create a new project. I've prepared scaffolding, which contains your plugin.

I would like to test it, but if my directory with svg files doesn't have any svg files, plugin will generate invalid stylesheet.

 {
    background-size: -Infinitypx -Infinitypx;
    background-repeat: no-repeat;
    background-image: url("svg-sprite.png");
}

.svg  {
    background-image: url("svg-sprite.svg");
}

First block doesn't have any identifier. background-size has invalid value (Infinity). Because of that Sass task will fail.

Everything works fine when directory with svg files will contain at least one svg file.

I can prepare some fix. Are you interested in?

phloe commented 8 years ago

Sure, PR's are always welcome :)

pomek commented 8 years ago

Hmm... Probably I created a issue in bad place :<

I will make a PR to correct repository.