Socket
Book a DemoInstallSign in
Socket

inline-svg-sprite

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inline-svg-sprite

Inlines an SVG sprite and updates references for IE compatablity

latest
npmnpm
Version
1.1.4
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

inline

FAQs

Package last updated on 05 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts