Skip to content

Commit

Permalink
feat(icons): New icons (#511)
Browse files Browse the repository at this point in the history
* New icons

* Add more icons

* Fix icon names

Co-authored-by: Tasso Evangelista <[email protected]>
  • Loading branch information
gabriellsh and tassoevan authored Aug 16, 2021
1 parent 2e9e497 commit 1fa7748
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions packages/icons/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,33 @@ Feel free to check the [issues](https://github.com/RocketChat/Rocket.Chat.Fusela

<!--/contributing(msg)-->

### Adding new icons

All the icons should be designed by Rocket.Chat's design crew, following some conventions:

- The view box must have the dimensions of 32x32 units;
- Any horizontal assimetry must follow the left-to-right direction.
- The icon must be published on Figma.

As the icons might be arbitrarily scaled, the chosen source format for individual icon graphics is
SVG. As Figma can export graphics with some additional SVG attributes and elements, they must be
removed:

- The `<svg>` element must contain only two attributes: `viewBox` (probably with the value of`"0 0 32 32"`) and
`xmlns`;
- XLink references (e.g. masks and clip paths) must be discarded;
- The `<path>` elements must keep only the `d` attribute, with no additional styling attribute;
- `<g>` and other elements must be stripped by some optimization tooling, keeping only `<path>` elements.

The `src/` directory holds all the SVG icons that would be processed. The filenames define the icon names, so they
should stick with a basic rule: **an icon name must describe the icon shape, not its utility**. For instance:

- [-] `message.svg` (wrong)
- [x] `balloon.svg` (right)

If the icon must be mirrored for right-to-left read direction, it required to add a trailing `.dir` before the file
extension (e.g. `backspace.dir.svg`).

### Building

As this package dependends on others in this monorepo, before anything run the following at the root directory:
Expand Down
21 changes: 21 additions & 0 deletions packages/icons/glyphsMapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -781,5 +781,26 @@
},
"headphone-off": {
"start": "\ue0d8"
},
"brush": {
"start": "\ue0d9"
},
"crop": {
"start": "\ue0da"
},
"cross-small": {
"start": "\ue0db"
},
"globe-off": {
"start": "\ue0dc"
},
"plus-small": {
"start": "\ue0dd"
},
"text-increase": {
"start": "\ue0de"
},
"text-decrease": {
"start": "\ue0df"
}
}
3 changes: 3 additions & 0 deletions packages/icons/src/brush.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/icons/src/crop.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/icons/src/cross-small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/icons/src/globe-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions packages/icons/src/new-window.dir.svg

This file was deleted.

3 changes: 3 additions & 0 deletions packages/icons/src/new-window.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/icons/src/plus-small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/icons/src/text-decrease.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/icons/src/text-increase.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1fa7748

Please sign in to comment.