How to add a new icon
Need to add a new icon to our library? Here's how to do it.
1. Add the SVG file
Add the SVG file into frontend/svg/material.
2. Adapt the SVG file
To work properly, the .svg file needs specific fill values:
- on the root
<svg />tag:fill="none" - on any other tag with a
fillproperty, it should be set tofill="black"This allows the script to replacefill="black"by thecurrentColorand allow customisation of the icon at runtime.
<!-- Before -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#232938">
<!-- After -->
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
3. Run the transform script
All icons are transformed to React components. To do so, run the following command:
~/frontend $ yarn murray:build-svg
How to export it from Figma
- First, make sure the icon is in a frame with a size of 24x24px.
- Then, select the icon and go to the export tabs in the right panel.
- Select SVG format and export it.