0.0.10 • Published 4 months ago

csvgtocss v0.0.10

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

Convert svg to css

npm version npm npm All Contributors

Demo

Github

Demo

Install

npm i csvgtocss@latest --save-dev

Setup

Create file: svgtocss.config.{ts,js,mjs}

import { defineConfig } from 'csvgtocss';

export default defineConfig({
  src: 'svg', // svg path
  dist: 'dist', // output path
  prefix: 'csvgtocss', // font name
  exportJson: true, // export json file
});

CLI (file package.json)

-c: Config
{
  ...
  "scripts": {
    ...
    "csvgtocss": "csvgtocss",
  },
  ...
}

Custom config file

  • You can also use a custom config file instead of svgtocss.config.{ts,js,mjs}. Just create <FILE_NAME>.config.{ts,js,mjs} to build command
Exp: awesome.config.ts;
{
  ...
  "scripts": {
    ...
    "csvgtocss": "csvgtocss -c awesome",
  },
  ...
}

Preview Icon

  • Install iconify-preview
  • Config .vscode/settings.json read file json icon which generate after run script
{
  "iconify.color": "#ddd",
  "iconify.customCollectionJsonPaths": ["./public/svgcss/icon-collection.json"], // path json file
  "iconify.delimiters": ["-"],
  "iconify.prefixes": ["", "icon"],
  "iconify.inplace": false,
  "iconify.annotations": true,
  "iconify.languageIds": ["typescript", "typescriptreact"]
}

Demo

About

Gia Hung – hung.hg

0.0.10

4 months ago

0.0.9

4 months ago

0.0.8

5 months ago

0.0.3

5 months ago

0.0.5

5 months ago

0.0.4

5 months ago

0.0.7

5 months ago

0.0.6

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago