To get started, clone the repo, install dependencies, and run the build script.
You must use Node v16 to build the project.
git clone https://github.com/trimble-oss/modus-icons/
cd modus-icons
npm i
npm run build
The site is built with Hugo and you can run a local server with the following command.
npm run docs:serve
Then open http://localhost:4000
in your browser. If you add or change any icons, you'll need to run npm run build
again to generate the new or changed pages.
Here are some key scripts you'll use during development. Be sure to look to our package.json
for a complete list of scripts.
Script | Description |
---|---|
build |
Optimize SVGs, create icon fonts, SVG sprites and output to dist dir |
docs:serve |
Starts a local Hugo server |
test |
Run tests on HTML, CSS, JavaScript and more |
New glyphs are designed on a 24x24px grid, then exported as flattened SVGs. Once a new SVG icon has been added to the icons
directory, we use an npm script to:
- Optimize our SVGs with SVGO.
- Modify the SVGs source code, removing all attributes before setting new attributes and values in our preferred order.