shakyShane / gulp-svg-sprites

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

Feature: null layout option for sprite mode #53

Open growdigital opened 10 years ago

growdigital commented 10 years ago

I'm pulling in the sprite.svg using Ajax.

Would be good to have the option to set layout to null, as I'm referencing the individual svg icons by their ID, so I don't need coordinates, which I'm having to strip out from the generated file.

layout variable is in here: https://github.com/shakyShane/gulp-svg-sprites/blob/master/index.js

growdigital commented 10 years ago

FWIW, I hacked this file:
/gulp-svg-sprites/node_modules/svg-sprite-data/lib/svg-sprite.js

with this:

        // No sprite arrangement
        case 'none':
            positionX = null;
            positionY = null;
            break;

And it seems to work, which is kind of handy. I don't know that JavaScript very well though, so could be horribly broken…

growdigital commented 10 years ago

Have created pull request for this file:

https://github.com/shakyShane/svg-sprite-data/blob/master/lib/svg-sprite.js