0.0.3 β€’ Published 2 months ago

vite-plugin-supericon v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

vite-plugin-supericon

icon list

npm npm GitHub

δΈ­ζ–‡

Converts svg solid colour icons in a project to font icons and provides an interactive interface. The core is implemented by fantasticon.

✨ Features

  1. Easily configurable with just one line.
  2. Automatically converts SVG to Iconfont.
  3. Provides a beautiful interactive user interface.
  4. Quick copy icon code functionality.
  5. Supports comparison between original and rendered images, allowing for quick difference checking.
  6. Intelligent prompting for duplicate icons.
  7. Multiple icon sorting and filtering options.
  8. Supports previewing generated icons in VSCode Iconify IntelliSense.

πŸ“¦ Install

npm i vite-plugin-supericon -D

# yarn
yarn add vite-plugin-supericon -D

# pnpm
pnpm add vite-plugin-supericon -D

πŸ¦„ Usage

  1. Add and configure the superIcon plugin to vite.config.js / vite.config.ts.
// vite.config.js / vite.config.ts
import { superIcon } from 'vite-plugin-supericon'

export default {
  plugins: [
    superIcon({
      srcDir: './src/assets/icons'
    })
  ]
}
  1. Introducing modules in the entry file
// main.ts / main.js
import 'virtual:supericon'
  1. Then run the service, click on the link in the terminal or open localhost:5173/__supericon/ to access the interactive interface.

The full demo can be found at demo

πŸ˜€ Iconify IntelliSense Support

Configure vscode settings for the workspace.

// .vscode/setting.json
{
  "iconify.customCollectionJsonPaths": ["node_modules/.supericon/iconify.json"]
}

Options

PropertyTypePartialDefaultDescription
srcDirstringnoSvg icons source folder.
basestringyesread from Vite's configBase URL for superIcon UI
clearCachebooleanyestrueclear cache pre server start
watchbooleanyestrueWatch srcDir files change
openbooleanyesfalseAutomatically open super icon page in browser
silentbooleanyesfalsePrint URL output silently in the terminal
namestringyesiconfontName of icons font
prefixstringyesiconIcon css class prefix
fontHeightnumberyes300the output font height (icons will be scaled so the highest has this height)
descentnumberyesfont descent
roundnumberyesiconsetup the SVG path rounding 10e12
selectorstringyesnulluse a CSS selector instead of 'tag + prefix'
tagstringyesnullCSS base tag for icons
cssTemplatestringyesiUse a custom Handlebars template file to generate css file(template file path)
normalizebooleanyestruenormalize icons by scaling them to the height of the highest icon

License

MIT licenses