Skip to content

Instantly share code, notes, and snippets.

@ChucKN0risK
Last active July 5, 2023 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChucKN0risK/b21ac81012a867167878b0756edbddab to your computer and use it in GitHub Desktop.
Save ChucKN0risK/b21ac81012a867167878b0756edbddab to your computer and use it in GitHub Desktop.
Generate icons as JSX components
{
"repository": "@owner/repository",
"personalAccessToken": "<your-personal-access-token>",
"rules": [
{
"name": "Icons",
"path": "./output/assets/icons",
"filter": {
"types": [
"vector"
]
},
"parsers": [
{
"name": "kebabcasify"
},
{
"name": "svgo",
"options": {
"svgo": {
"plugins": [
{
"removeDimensions": true
},
{
"removeAttrs": {
"attrs": "*:(fill|stroke)"
}
}
]
}
}
},
{
"name": "svg-to-jsx",
"options": {
"prepend": "import React from 'react';",
"formatConfig": {
"variableFormat": "camelCase"
},
"wrapper": {
"tag": "div",
"className": "icon-{{name}} icon"
}
}
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment