The BookingJini Icons project is a structured repository for converting SVG icons to web fonts using fantasticon
, svgo
, and oslllo-svg-fixer
. This project follows an automated workflow to ensure smooth processing, optimization, and publishing of the icons to npm.
π Visit the official website: icons.bookingjini.com
For a structured list of all available icons, refer to the Icons Table.
Ensure you have Node.js 20.13.1 installed.
Note: This version is specifically used as
fantasticon
is throwing some errors on the updated version. Any fix to this problem is much appreciated.
git clone https://github.com/your-repository/bookingjini-icons.git
cd bookingjini-icons
npm install
You can install and use the icon font in any project:
npm install @bookingjini-labs/bookingjini-icons
Then, in your CSS:
import "@bookingjini-labs/bookingjini-icons/fonts/bookingjini-icons.css";
You can use the BookingJini Icons library without installing it by including the following CDN link:
<!-- Add this inside your HTML file -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@bookingjini-labs/bookingjini-icons/dist/fonts/bookingjini-icons.css"
/>
You can use the icons in your HTML like this:
<i class="icon-ac-fill"></i>
At BookingJini Labs, we needed a scalable and maintainable icon library to streamline our design and development workflow. In the past, we attempted to build an open-source icon library, even listing it in Google Summer of Code (GSoC) to encourage community contributions. However, managing unstructured changes became overwhelming, leading to inconsistencies, and the project was eventually discontinued.
With the need resurfacing, we decided to rebuild the library with automation at its coreβeliminating manual steps like SVG optimization and font generation. This time, instead of keeping it internal, we published it as an npm package, making it publicly accessible for others to use, enhance, and contribute, while ensuring it remains structured and maintainable. π
In the previous version, the process of maintaining icons involved several manual steps:
1οΈβ£ Designers provided SVGs.
2οΈβ£ We manually converted them into web fonts using IcoMoon.
3οΈβ£ The generated CSS was manually uploaded to a CDN (e.g., jsdelivr).
4οΈβ£ Every icon update required repeating this tedious process.
This approach was inefficient, time-consuming, and prone to errors.
To eliminate manual intervention, we completely revamped the workflow:
β
Automated font generation using fantasticon
. (Due to compatibility issues, we use fantasticon@1.2.3
, which works seamlessly with Node.js 20.13.1
.)
β
Automated SVG optimization using oslllo-svg-fixer
and svgo
to fix and compress icons.
β
Fully integrated build process that handles everything from SVG processing to publishing the package on npm.
We are continuously improving this package to make it more efficient, scalable, and developer-friendly. Your feedback, contributions, and suggestions are always welcome! π
bookingjini-icons/
βββ font-dist/ # π¨ Contains the final generated font files
βββ icons-dist/ # π Contains the fixed and optimized SVG icons
βββ icons-source/ # π Contains the raw SVG icons before processing
βββ .github/ # π Contains the GitHub Actions workflow for publishing
βββ .gitignore # β Ignores node_modules and other unnecessary files
βββ package.json # π Contains the project configuration and scripts
βββ svgo.config.js # βοΈ Configuration for SVG optimization
βββ README.md # π Documentation
To process and convert SVG icons into a web font, we use the following npm tools:
npm install -g fantasticon@1.2.3 # π Specific version to avoid punycode error
npm i -D svgo # π¨ Optimizes SVG files
npm install oslllo-svg-fixer # π Fixes SVG formatting issues
The package.json
file defines project metadata and scripts. Below is a breakdown of the scripts section:
{
"name": "@bookingjini-labs/bookingjini-icons",
"description": "A custom icon font library for BookingJini",
"version": "1.0.0",
"main": "dist/fonts/bookingjini-icons.css",
"exports": {
"./bookingjini-icons.css": "./dist/fonts/bookingjini-icons.css"
},
"files": ["dist/fonts/"],
"publishConfig": {
"access": "public"
},
"license": "MIT",
"scripts": {
"build": "npm run icons:fix && npm run icons:compress && npm run icons:font",
"icons:fix": "node node_modules/oslllo-svg-fixer/src/cli.js -s=src/svg -d=dist/svg",
"icons:compress": "svgo dist/svg -o dist/svg --config=svgo.config.js",
"icons:font": "fantasticon"
},
"dependencies": {
"oslllo-svg-fixer": "^5.0.0"
},
"devDependencies": {
"fantasticon": "^1.2.3",
"svgo": "^3.3.2"
},
"keywords": [],
"repository": {
"type": "git",
"url": "git+https://github.com/ramanujamgond/bookingjini-icons.git"
}
}
build
: π Runs the complete build process by executingicons:fix
,icons:compress
, andicons:font
sequentially.icons:fix
: π§ Usesoslllo-svg-fixer
to clean and standardize raw SVGs fromicons-source/
and save them inicons-dist/
.icons:compress
: π¨ Usessvgo
to optimize the cleaned SVG files inicons-dist/
and outputs them intofont-dist/
usingsvgo.config.js
.icons:font
: π Usesfantasticon
to convert optimized SVG files into web font files stored infont-dist/
.test
: π Placeholder test script that currently outputs an error.
This configuration optimizes SVG files by removing unnecessary metadata and formatting.
module.exports = {
multipass: true, // π Runs multiple passes to optimize SVG further
plugins: [
{ name: "removeViewBox", active: false }, // πΌ Keeps the viewBox attribute (important for scaling)
{ name: "removeDimensions", active: true }, // π Removes width/height attributes to make the SVG responsive
{ name: "convertColors", params: { currentColor: true } }, // π¨ Converts colors to `currentColor` for theme-based coloring
{ name: "cleanupNumericValues", params: { floatPrecision: 2 } }, // π’ Reduces the number of decimal places in numeric values
],
};
This repository includes an automated workflow inside .github/workflows/
that handles:
- π Processing & optimizing SVG icons
- π¨ Generating web fonts using
fantasticon
- π¦ Publishing to npm
- β If punycode errors occur, ensure you are using
fantasticon@1.2.3
. - β Ensure
icons-source/
contains valid SVG files before runningnpm run build
. - β If publishing issues occur, check GitHub Actions logs in
.github/workflows/
.