Skip to content

anseki/polyfill-svg-bg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polyfill SVG as BG for IE

Use polyfillSvgUri instead of this.

This project was altered to polyfillSvgUri.


Polyfill for IE to set SVG to CSS background-image.

The plain SVG without Base64 encoding that is written in the CSS background-image is small size, readable and editable.

div {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96"><path d="M10,10L32,90L90,32z" fill="lightgreen"/></svg>') center no-repeat;
}

But IE ignores it.
This polyfill solves that problem. It passes encoded SVG to IE.

Usage

<script src="polyfill-svg-bg.min.js"></script>

About

Polyfill for IE to set SVG to CSS `background-image`.

Resources

License

Stars

Watchers

Forks

Packages

No packages published