Skip to content

mrchimp/inlinesvg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inline SVG

If inline SVGs are supported, img tags such as <img src="foo.svg"> are replaced with the inline contents of foo.svg.

If inline SVGs are NOT supported but SVGs ARE, then the img tag will be left as it is.

If neither SVGs NOR inline SVGs are supported, a PNG will be loaded in its place.

Read more in this blog post

Restrictions

The SVGs and PNG equivalents must have the same path and name (except for the file extension).

Due to the same-origin policy you may have problems using this with local

Usage

See example.html for usage. There's not a lot to it.

License

MIT License

Includes SVG and InlineSVG checks from Modernizr.

About

Convert image tags to inline SVG markup

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published