https://github.com/ayan4m1/svg-fab
https://github.com/ayan4m1/svg-fab
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ayan4m1/svg-fab
- Owner: ayan4m1
- License: mit
- Created: 2019-09-05T12:56:50.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-11-25T12:13:01.000Z (over 3 years ago)
- Last Synced: 2025-03-30T15:44:50.328Z (over 1 year ago)
- Language: JavaScript
- Size: 801 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# svg-fab
This utility will convert a Sketch-exported SVG into a `` element suitable for use as an icon.
## Usage
The source SVG must be composed of a single path - use the "Layer > Convert to Outlines" command in Sketch.
Once you have your SVG, install the utility:
```sh
npm install -g svg-fab
```
Then, specify a name for the symbol and the path to the SVG like so:
```sh
svg-fab -n expand my-expand-icon.svg
```
The utility prints its output to stdout. You can copy and paste the `` element it generates into your sprite sheet.
The name argument is automatically [slugified](https://github.com/simov/slugify) - wrap it in double quotes if it contains spaces. For example:
```sh
svg-fab -n "my extremely long, convoluted, and entirely unfriendly icon name" my-icon.svg
```
In this example the exported `` will have an `id` attribute of `icon-my-extremely-long-convoluted-and-entirely-unfriendly-icon-name`.