You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(#280): adds icon component with material desing icons (#384)
- Removes icomoon
- Adds new dependency with Material Design icons `@mdi/js`
- Adds a new icon component that imports Material Design icons, has variants, and sizes.
- Our lint requires a two-word name for components. That's why the name is `IconSVG`
- Replace all icons with the new component
Copy file name to clipboardExpand all lines: packages/web-forms/README.md
+8-10
Original file line number
Diff line number
Diff line change
@@ -106,18 +106,16 @@ This package uses the Material Design system for the UI, though not strictly. Th
106
106
107
107
### Icons
108
108
109
-
We use **Material Icons** using IcoMoon to select a subset of icons in order to minimize the size. The font files are located in [`./src/assets/fonts/`](./src/assets/fonts/), and the CSS is [`./src/assets/css/icomoon.css`](/src/assets/css/icomoon.css). Our IcoMoon definition is in the root directory of this package at [`./icomoon.json`](./icomoon.json).
109
+
The `IconSVG` component renders Material Design Icons (MDI) with customizable size and style variants. It uses the `@mdi/js` library for icon data and supports a predefined set of icons.
110
110
111
-
To update the icons using the [IcoMoon website](https://icomoon.io/app/):
1. Click the "Import Icons" button in IcoMoon. Select [`icomoon.json`](/icomoon.json). When prompted, load the settings stored in the file.
114
-
2. Scroll down to the "Add Icons From Library" link and add **Material Icons**.
115
-
3. Move the imported set above Material Icons, using the 3-bar icon to the right of the imported set's title. (This should help preserve the icon order and minimize the diff.)
116
-
4. Update the icons by selecting (highlighting) the new icons to add. They don't need to be moved or altered.
117
-
5. Download the new font, then copy the files (`icomoon.css`, `fonts/*`, `icomoon.json`) into their locations in the repository.
118
-
- You will need to rename the files and update the paths in the CSS (`fonts/icomoon.ttf?...` becomes `/fonts/icomoon.ttf?...` with a beginning slash).
119
-
- You will also need to prettify the JSON file to use two space indentation.
115
+
To add a new icon:
120
116
121
-
By following the steps above, you should minimize the diff. However, in the JSON file, you may still see changes for properties like `id`, `iconIdx`, `setId`, and `setIdx`.
117
+
- Import the icon from `@mdi/js` in the `IconSVG` component.
118
+
- Add the icon to the `iconMap` object with its corresponding name.
119
+
- Use the icon by passing its name to the `name` prop.
122
120
123
121
Material Icons are available under the Apache License Version 2.0. Copy of the license can be found at [`./src/assets/fonts/LICENSE-2.0.txt`](./src/assets/fonts/LICENSE-2.0.txt)
0 commit comments