33The Epic Stack uses SVG sprites for
44[ optimal icon performance] ( https://benadam.me/thoughts/react-svg-sprites/ ) .
55You'll find raw SVGs in the ` ./other/svg-icons `  directory. These are then
6- compiled into a sprite using the ` npm run build:icons `  script which generates
7- the ` icon.svg `  file and an ` icons.json `  manifest file that allows Typescript to
8- pick up the names of the icons.
6+ compiled into a sprite using the
7+ [ ` vite-plugin-icons-spritesheet ` ] ( https://github.com/jacobparis-insiders/vite-plugin-icons-spritesheet ) 
8+ plugin which generates the ` app/components/ui/icons/sprite.svg `  file and the
9+ accompanying ` types.ts `  file that allows Typescript to pick up the names of the
10+ icons.
911
1012You can use [ Sly] ( https://github.com/jacobparis-insiders/sly/tree/main/cli )  to
1113add new icons from the command line.
@@ -21,20 +23,16 @@ icons available in the `@radix-ui/icons` collection and let you select the ones
2123you want to add.
2224
2325Sly has been configured in the Epic Stack to automatically add the icons to the
24- ` ./other/svg-icons `  directory and to run the ` npm run build:icons `  script
25- automatically, so there are no extra steps to take. You can see the
26- configuration in the ` ./other/sly/sly.json `  file.
26+ ` ./other/svg-icons `  directory, so there are no extra steps to take. You can see
27+ the configuration in the ` ./other/sly/sly.json `  file.
2728
2829The SVGs used by default in the Epic Stack come from
2930[ icons.radix-ui.com] ( https://icons.radix-ui.com/ ) . You can download additional
3031SVG icons from there, or provide your own. Once you've added new files in the
31- directory, run ` npm run build:icons `  and you can then use the ` Icon `  component
32- to render it. The ` icon `  prop is the name of the file without the ` .svg ` 
33- extension. We recommend using ` kebab-case `  filenames rather than ` PascalCase `  to
34- avoid casing issues with different operating systems.
35- 
36- Note that the ` ./other/build-icons.ts `  file automatically removes ` width `  and
37- ` height `  props from your SVGs to ensure they scale properly.
32+ directory, run ` npm run build `  and you can then use the ` Icon `  component to
33+ render it. The ` icon `  prop is the name of the file without the ` .svg `  extension.
34+ We recommend using ` kebab-case `  filenames rather than ` PascalCase `  to avoid
35+ casing issues with different operating systems.
3836
3937By default, all the icons will have a height and width of ` 1em `  so they should
4038match the font-size of the text they're next to. You can also customize the size
0 commit comments