|
2 gadi atpakaļ | |
---|---|---|
.. | ||
dist | 2 gadi atpakaļ | |
CHANGELOG.md | 2 gadi atpakaļ | |
LICENSE | 2 gadi atpakaļ | |
README.md | 2 gadi atpakaļ | |
package.json | 2 gadi atpakaļ |
tiny-svg is a minimal toolbelt for creating clean SVG applications.
2kB
minified + gzippedinnerSVG
supportCheckout provided utilities.
import {
appendTo,
classes,
create,
innerSVG
} from 'tiny-svg';
var container = document.createElement('div');
var element = appendTo(create('svg'), container);
var g = appendTo(create('g'), element);
// add classes, SVG style!
classes(g).add('foo');
var text = `
<g class="foo bar">
<rect x="0" y="0" width="0" height="0" rx="50" ry="50"/>
</g>
`;
// set innerSVG
innerSVG(g, text);
Your favourite module bundler should apply tree-shaking to only include the components your application requires. If you're using CommonJS modules give common-shake a try.
MIT