Skip to content

Commit 1f37f70

Browse files
committed
feat(ui-icons): add give-award, grid-view, list-view icons
Closes: INSTUI-4234 TEST PLAN: Check the icons in the docs, check all 3 formats
1 parent 0670648 commit 1f37f70

File tree

9 files changed

+122
-314
lines changed

9 files changed

+122
-314
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: Adding new icons
3+
category: Contributor Guides
4+
order: 9
5+
---
6+
7+
## Adding and Modifying Icons
8+
9+
- Use dashes in the name of the .svg files (e.g `calendar-month`).
10+
Use the same name for the "line" and "solid" variants, and save them in the respective folder, e.g. `Solid/calendar-month` and `Line/calendar-month`.
11+
12+
- Copy the new icon files in the `/svg/Solid` and `/svg/Line` directories.
13+
14+
- Double-check that the SVG size is 1920x1920.
15+
16+
```html
17+
---
18+
type: code
19+
---
20+
21+
<svg
22+
width="1920"
23+
height="1920"
24+
viewBox="0 0 1920 1920"
25+
fill="none"
26+
xmlns="http://www.w3.org/2000/svg"
27+
>
28+
{...}
29+
</svg>
30+
```
31+
32+
- The files cannot contain [clipping paths](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/clipPath)! Sadly, when the Designers export icons from Figma, most of the time they have a clipping path around the whole canvas. If the source code has them, manually refactor the code, e.g:
33+
34+
```html
35+
---
36+
type: code
37+
---
38+
39+
// Before:
40+
<svg
41+
width="1920"
42+
height="1920"
43+
viewBox="0 0 1920 1920"
44+
fill="none"
45+
xmlns="http://www.w3.org/2000/svg"
46+
>
47+
<g clip-path="url(#clip0_1007_24)">
48+
<path d="..." fill="#2D3B45" />
49+
</g>
50+
<defs>
51+
<clipPath id="clip0_1007_24">
52+
<rect width="1920" height="1920" fill="white" />
53+
</clipPath>
54+
</defs>
55+
</svg>
56+
57+
// After:
58+
<svg
59+
width="1920"
60+
height="1920"
61+
viewBox="0 0 1920 1920"
62+
fill="none"
63+
xmlns="http://www.w3.org/2000/svg"
64+
>
65+
<path d="..." fill="#2D3B45" />
66+
</svg>
67+
```
68+
69+
- If the icon has to bidirectional (being mirrored in RTL mode, typically arrow icons), add the icon name to the bidirectional list in `packages/ui-icons/icons.config.js`. Deprecated icons are handled here as well.
70+
71+
- Run `npm run export:icons` from the repository root directory to generate the icons. This script will also take care of further optimizations on the SVG files (e.g. removing the `fill`s). The configs for this are located in `packages/ui-icons-build/lib/tasks/optimize-svgs/index.js` and `packages/ui-icons/svgo.config.js`.
72+
73+
- Run `npm install && npm run bootstrap`.
74+
75+
- Finally, run `npm run dev` from the repository root directory to start the local server and check the generated output.
76+
77+
- Verify icons display correctly by checking under [Icons](/#icons) in the main nav. Check all 3 versions (React, SVG and icon font).
78+
79+
(Note: The fonts are sometimes not rendered correctly, but we decided not to fix them, because they are not really used anywhere, and we might stop supporting icon fonts in the future in general.)
80+
81+
### Guidelines for Drawing Icons
82+
83+
- Draw your icons on the 1920 x 1920 art-boards.
84+
85+
- Before you flatten shapes or vectorize strokes as described below, make a hidden copy of the original paths off
86+
to the side so that you can more easily come back and make changes later.
87+
88+
- Flatten your shapes.
89+
90+
- Export strokes to vector.
91+
92+
- Don’t use borders on vectors, especially not inside/outside borders which aren’t supported in SVG. Do not use clipping paths.
93+
94+
- Make sure none of the paths go outside of the art-board. If so, the glyph in the icon font will be misaligned.
95+
Draw inside the lines.
96+
97+
- Fill the space edge-to-edge as much as possible. The build process will add margins as needed.

docs/patterns/DrilldownMenu.md

Lines changed: 0 additions & 223 deletions
This file was deleted.

0 commit comments

Comments
 (0)