Skip to content

Rewrite a set of svg files with unique ids so they don't override each other on webpages.

Notifications You must be signed in to change notification settings

jpfiorilla/svg-unique

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Edit your SVGs to have unique markup

Programs like Sketch output their .svg files with the same ids as each other by default, which causes the svgs to override each other's markup when multiple are displayed on a webpage.

This script solves this issue by renaming the id and class attributes of all SVG elements to be unique.

Install:

$ npm i -g svg-unique

Use:

$ svgu

or

$ svgu --input=./customInputDir --output=./customOutputDir

Argument Use Default value
--input Custom input directory .
--output Custom output directory --input

About

Rewrite a set of svg files with unique ids so they don't override each other on webpages.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published