SVGStore Plugin for FuseBox
This FuseBox plugin allows you to handling SVG files with svgstore. It exports SVG texts those are wraped with <symbol>
elements and path to them. Useful for structuring SVG sprites.
Install
npm i --save-dev fuse-box-svgstore-plugin
or
yarn add --dev fuse-box-svgstore-plugin
Usage
- Configure your
fuse.js
file like below.const FuseBox = ;const SVGStorePlugin = ;const fuse = FuseBox;// ... - Import
svg
andpath
from your SVG files.;console;// <svg><symbol id="...id_for_sprite...">...</symbol></svg>console;// #...id_for_sprite... - Inject SVG element to the DOM tree. For example,const e = document;einnerHTML = svg;efirstElementChildstyledisplay = 'none';documentbody;
- Use SVG symbols in everywhere you need with
<use>
tag.<!-- Non displayed SVG is injected here by previous step. -->const target = documentbody;targetinnerHTML = ``;
Options
No options available now.