-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(intenral-docs): add icons doc (#4215)
* chore(intenral-docs): add icons doc * chore(internal-docs): backend development * chore(internal-docs): update backend docs * chore(internal-docs): fix typo --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
82d9d42
commit e946be8
Showing
3 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Icons | ||
|
||
- [Icons](#icons) | ||
- [Adding Icons](#adding-icons) | ||
- [Generating Icons](#generating-icons) | ||
|
||
Our icons are converted from SVG to React components at compile time using our own “svg-to-react” library: [https://github.com/twilio-labs/svg-to-react](https://github.com/twilio-labs/svg-to-react) | ||
|
||
## Adding Icons | ||
|
||
The process for adding icons is very simple thanks to our naming conventions and conversion library. | ||
|
||
Any new SVG assets must be copied into the [svg](../../packages/paste-icons/svg/) folder. We often see the `viewBox` attribute missing so be sure the top level element has the following: | ||
|
||
```html | ||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none"> | ||
``` | ||
|
||
## Generating Icons | ||
|
||
To generate newly added icons you can use the command `yarn convert:icons:new` from the root of the repo. This will create the new React components and appends the "Icon" string to the component name. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters