- Notifications
You must be signed in to change notification settings - Fork0
Ember addon to combine SVG files into one JS file and inject it through dedicated component into application. It makes maintenance of SVGs easy and deliver the best possible interaction with SVGs.
License
vastec/ember-cli-misvg
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Ember addon to combine SVG files into one JS file and inject it through dedicated component into application. It makes maintenance of SVGs easy and deliver the best possible interaction with SVGs.
ember install ember-cli-misvg
Define where your SVG icons are inpublic
directory (sourceDirs
param) and where the outputshould be placed (outputFile
param). Like this:
// ember-cli-build.jsletapp=newEmberApp(defaults,{misvg:{files:{sourceDirs:'public/img/svg-icon',outputFile:'/assets/svg-sprites.js'},misvgOptions:{indent:2}}});
Optionally you can also passmisvg configuration options viamisvgOptions
property.
Add generated script file that contains sprites to your project:
// index.html<scriptsrc="{{rootURL}}assets/svg-sprites.js"></script>
Usemisvg-icon
component with thename
of SVG icon (in align with the filename). You can also scale it viawidth
andheight
params.
{{misvg-iconname="star"width=20height=20}}
git clone https://github.com/vastec/misvg.git
cd ember-cli-misvg
npm install
npm run lint:js
npm run lint:js -- --fix
ember test
– Runs the test suite on the current Ember versionember test --server
– Runs the test suite in "watch mode"ember try:each
– Runs the test suite against multiple Ember versions
ember serve
- Visit the dummy application athttp://localhost:4200.
For more information on using ember-cli, visithttps://ember-cli.com/.
This project is licensed under theMIT License.
About
Ember addon to combine SVG files into one JS file and inject it through dedicated component into application. It makes maintenance of SVGs easy and deliver the best possible interaction with SVGs.