shakyShane / gulp-svg-sprites

Create SVG sprites or compile to <symbols>
MIT License
334 stars 45 forks source link

Negative value in viewBox attribute #121

Open Postnov opened 5 years ago

Postnov commented 5 years ago

When files are compiled, negative values become positive and "NaN" is added before them. NaN is not a problem, I remove it with gulp-replace. The problem is that I cannot return negative viewBox values, which gulp-svg-sprites replaced with positive ones.

Gulp-task

.pipe(svgSprite({
    mode: "symbols",
    // preview: false,
    selector: "svg-%f",
    svg: {
        symbols: 'svg_sprite.pug'
    }
}

Init svg viewBox: viewBox="-49 141 512 512" Finish svg viewBox: viewBox="NaN 49 141 512 512"