mirror of
https://github.com/trezor/trezor-suite.git
synced 2026-03-08 00:07:58 +01:00
@suite-common/icons
This package contains source assets for icons used in the app.
How to add or update icon
- Export icon as SVG from Figma (no other types than SVG are allowed).
- Rename icon to follow camel case convention (
Warning Circle.svg=>warningCircle.svg). - Run
yarn generate-icons- this will do some necessary changes in SVG structure like removing dimensions and some optimization using SVGO library. It will also regeneratesrc/icons.tsfile. - You can use your newly added icon 🎉.
How to update icon font for mobile app
- Register new icon in
generateIconFont.tsfile. - Run
yarn generate-iconsto generate new font file. - Rebuild/restart app (incl. shutting down emulator & rerunning
yarn native:prebuild).
In case some icons are not rendering correctly in icon font
- Copy path from svg file of broken icon.
- Open
https://codepen.io/herrstrietzel/pen/GRGexdband paste path there. - Uncheck
directionscheckbox. - Inspect fix path output preview SVG in Chrome DevTools.
- Copy SVG code from Chrome DevTools and replace original SVG code (do not use that fixed path directly, it won't work for some reason).
- Regenerate icons with
yarn generate-icons.