polyfill-svg-bg

0.1.1-x • Public • Published

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>

Package Sidebar

Install

npm i polyfill-svg-bg

Weekly Downloads

0

Version

0.1.1-x

License

MIT

Last publish

Collaborators

  • anseki