Skip to content

kirbydesign/svg_formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SVG formatter

                     _______________________________________
                     │                                      │
                     │----------Formatting SVG's!-----------│
                     │                                      │
                     │   ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣠⣤⣤⣤⣄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀   │
                     │   ⠀⣠⡶⠒⠒⠶⣄⣠⡴⠚⠉⠁⠀⠀⠀⠀⠀⠉⠙⠳⢦⡀⠀⠀⠀⠀⠀⠀   │
                     │   ⢠⡏⠀⠀⠀⠀⠘⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢧⡀⠀⠀⠀⠀   │
                     │   ⢸⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠋⢱⠀⠀⢠⠉⢡⠀⠀⠀⠀⠀⠻⡄⠀⠀⠀   │
                     │   ⠀⣧⠀⠀⠀⠀⠀⠀⠀⠀⢸⣧⣾⠄⠀⢸⣦⣾⠀⠀⠀⠀⠀⠀⢻⡄⠀⠀   │
                     │   ⠀⠘⢧⡀⠀⠀⠀⠀⠀⠀⠈⣿⣿⠀⠀⠸⣿⡿⠀⠀⠀⠀⠀⠀⠈⠳⣄⠀   │
                     │   ⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠈⠁⡴⠶⡆⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠹⡄   │
                     │   ⠀⠀⠀⢷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠒⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣷   │
                     │   ⠀⠀⠀⠸⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⠇   │
                     │   ⠀⠀⠀⣀⡿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡽⣿⡛⠁⠀   │
                     │   ⠀⣠⢾⣭⠀⠈⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠀⢠⣝⣷⡀   │
                     │   ⢠⡏⠘⠋⠀⠀⠀⠈⠑⠦⣄⣀⠀⠀⠀⠀⠀⣀⡠⠔⠋⠀⠀⠀⠈⠛⠃⢻   │
                     │   ⠈⠷⣤⣀⣀⣀⣀⣀⣀⣀⣀⣤⡽⠟⠛⠿⣭⣄⣀⣀⣀⣀⣀⣀⣀⣀⣤⠞   │
                     │   ⠀⠀⠀⠀⠉⠉⠉⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠀⠀⠀   │
                     │                                      │
                     │______________________________________│

Why do we have this scipt? Because thenever we export SVG's from zeplin, the fill-property has the wrong value, and changing all of them is a cumbersome task.

How to use

NodeJS

Make sure you have Node.js installed. Run the following to verify: node -v. If it is not installed, it can be done here.

Installl packages

The script need a few packages to work. Before running the script, run npm install.

Run the script

The format-svg.js file is at the root of the project. The script takes a files folders containing all the svg's needed, sorted into sub-folders.

ICON_FORMATTER
│  README.md
│  format-svg.js
│  package.json
│__files
│  │__folder1
│  │    iconA.svg
│  │__folder2
│  │    iconB.svg
│
│__out // generated by the script
   │__folder1
   │    iconA.svg
   │__folder2
   │    iconB.svg

Run the format-svg.js script with the following command: npm run format.

After the script has run, the out folder contains the svg's in the same folder structure as the files folder.

About

a tool to format Kirby SVG fills

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published