Skip to content

nagyistge/svg-sprites

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Making svg sprites with gulp

Just a simple demo gulp task that makes an optimised svg sprite, using symbols, to be injected inline into the document. To get started, just clone the repository and do npm install. If you're using express, you can simply read the contents of the file:

var app = require("express")();
var fs = require("fs");

// Set contents of the sprite as a local variable in the template.
app.locals.svgSprite = fs.readFileSync("public/sprite.svg");

Symbols could be used like so:

<svg><use xlink:href="#svg-plus"></use></svg>

Where #svg-plus comes from the filename plus.svg prefixed with svg-. You can now manipulate/animate your SVGs just with CSS!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published