@payping/icons
v1.5.3
Published
1. Get `svg` format of the new icon and add its file to images folder.
Downloads
55
Keywords
Readme
@PayPing/icon package
How to add new icon
- Get
svg
format of the new icon and add its file to images folder.
If you need to add initial conversions for your SVG code you can run the svgo script for your file
svgo -i src/images/Add.svg
- The new icon's
viewBox
attribute should be the following:
viewBox="0 0 24 24"
- If
viewBox
needs to be changed, the size of our icon should also change, so we should open it with a svg editor (e.g. inkscape) and edit its size to fill the newviewBox
. - After editing, we should save the new icon as
Optimized svg
(to remove all unnecessary attributes). - Depending on the type of icon we might need
fill="currentColor"
(e.g. ant icons) orfill="none" stroke="currentColor"
(e.g. feather icons).
How build works
- Initially there is only an images folder inside our src folder.
- When
build
script is executed it will generate the icons folder by compiling images with.svgorc.json
config. - This config files includes the required attribute that should be added to all icons (e.g.
className="PayPing-icon
). - A complete list for this config file is available at SVGO repo.
How to publish
- Create a release branch for the new version.
- Increase the version in package.json file.
- Run
customPublish
script to publish it to npm. - Close release branch.