npm i @koobiq/icons
Install dependencies by running:
yarn install
- Draw your icon in Koobiq Icons figma file.
- Make icons contains the only single outlined and flattened path with name
shape(second-color path with nameshape-2). - Using a Fill Rule Editor plugin, set shapes' fill rule to Non-zero fill. Make sure icon is rendered correctly.
- Run flatten for shapes one more time (there is a bug in Figma).
Create a file with name .env and add there your Figma access token.
To export your icons (SVG) from Figma run the command:
yarn run figma:sync
Change mapping.json:
- Add an entry into
mapping.jsonwith a new codepoint keys. - Edit the name of an icon in the
mapping.jsonin case of icon rename
Commit SVG files mapping.json and push all changes to git.
Run stage commit script to create a new release tag.
yarn run stage:commit
Use semver for version naming. So increment major (first) version number if any of these changes were made:
- Any icon name was changed (breaking changes for front-end developers)
- Any icon codepoint was changed (breaking changes for tech writers)
- Significant changes in icon metaphor (breaking changes for all)
This guide explains how to structure SVGs for dynamic styling via CSS, allowing different parts to be colored separately using fill and color.
- Primary Zone: No
fillattribute. - Secondary Zone(s):
fill="currentColor".
CSS styling:
svg {
fill: #8f99aa; /* Primary zone */
color: #00ff00; /* Secondary zone(s) */
}For details, see CSS-Tricks.
To facilitate automated processing during the build phase, we follow these conventions in Figma:
- Primary Zone:
#21222C(black). - Secondary Zone(s):
#E21D03(red).
These colors serve as a contract between the Figma design file and the build system. The build process recognizes these colors and applies the appropriate transformations to ensure the correct fill behavior in the final SVG output.
- Remove
fillfrom the primary zone. - Set secondary zones to
fill="currentColor". - Use CSS for styling.