convert-figma-svgs-for-react
Advanced tools
Comparing version
{ | ||
"name": "convert-figma-svgs-for-react", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "A small script for a very specific use case.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
## Overview | ||
A stopgap script for a very specific use case - having exported `.svg` files from Figma, I want to make them available as `.js` modules that just export the `<svg>` as a String, so that I can use it inline in `create-react-app` with `dangerouslySetInnerHTML`. | ||
A stopgap script for a very specific use case - having exported `.svg` files from Figma, I want to make them available as `.js` modules that just export the `<svg>` as a String, so that I can use SVGSs inline in `create-react-app` with `dangerouslySetInnerHTML`. | ||
@@ -12,1 +12,9 @@ Searches the directory supplied as the first command-line argument for `.svg` files to convert to `.js` files, which are named identically and placed in the same directory. *Not* a recursive search, only parses `.svg` files right in the specified directory. | ||
``` | ||
If you just want to use the function that cleans up an SVG exported from Figma, so that it doesn't use `<defs>` and `<use>`, you can also | ||
```javascript | ||
var reformatFigmaSvg = require('convert-figma-svgs-for-react').reformatFigmaSvg | ||
// or | ||
import { reformatFigmaSvg } from 'convert-figma-svgs-for-react' | ||
``` |
20404
1.55%20
66.67%