How we manage icons in Rocket.Chat?
- 2020-3-6
- Add a new SVG icon file into
app/ui-master/public/icons
folder - Run the automation script
node ../generateSprite.js
to generateicons.svg
from those SVG files in the above folder. (the SVG's filename is exactly the icons' identifier) - In the
meteor.startup
callback function, usingAsset.getText
to downloadicons.svg
file as plain text to the client first, and then with the help ofinjectIntoBody
function to insert the entire content as raw text into the body.
Note: the generated icons.svg
the file contains multiple icons, where we use the tag symbol
as a delimiter.