inline-svg-sprite
Inlines an SVG sprite and updates references for IE compatablity
Last updated 6 years ago .
· Original npm · Tarball · package.json
$ cnpm install inline-svg-sprite 
SYNC missed versions from official npm registry.

inline-svg-sprite

npm install inline-svg-sprite --save-exact

Inspired by https://css-tricks.com/ajaxing-svg-sprite/. Inlines external svgs sprites and updates xlink:href attributes in <use> tags to reference the inlined svg.

Usage

import inlineSvgSprite from 'lib/inline-svg-sprite'

// For our good friends IE 11 and below :)
inlineSvgSprite(spritePath, iconSelector)
spritePath

string, required

The path to your icon-sprite.

iconSelector

string, optional

Default: svg.icon

This selector is used to find svg elements and update the xlink:href attributes in <use> tags. When an SVG is inlined, full urls are stripped, leaving just the ID.

Current Tags

  • 1.1.4                                ...           latest (6 years ago)

7 Versions

  • 1.0.0                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.1.1                                ...           6 years ago
  • 1.1.2                                ...           6 years ago
  • 1.1.3                                ...           6 years ago
  • 1.1.4                                ...           6 years ago
Maintainers (1)
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright © npmmirror.com | 浙ICP备15033595号-63 |