generating-icons
Installation
SKILL.md
Generating Medusa Icons
Draws an SVG that matches the existing icon set, validates it, and converts it with the same SVGR pipeline as yarn generate.
Constraints
CRITICAL: Icons from this skill go in
src/custom/, neversrc/components/.yarn generatedeletessrc/components/and rebuilds it from Figma;src/custom/is untouched by it.
- Never hand-write the
.tsx: write an SVG, then runicon.mjs emit. The script writes the component, the spec, andindex.tsinsrc/custom/. - Names are unique across both directories:
emitrefuses a name Figma already exports. If Figma later adds an icon with the same name, the build fails on the duplicate export: delete thesrc/custom/copy, its spec, and its line insrc/custom/index.ts. #18181Bis the only themeable color: uppercase, exactly. It becomes{color}.currentColorand any other hex stay hardcoded.- Outline is the default style: live strokes,
stroke-width="1.5",stroke-linecap="round",stroke-linejoin="round", no fill. - Solid is fill-only:
-solidicons usefill="#18181B"shapes, no strokes. - Canvas is 15x15:
width="15" height="15" viewBox="0 0 15 15" fill="none"on the root. - Style is decided by the markup, not by how a usage site renders it: an icon whose paths are
strokeonly is an outline. If it looks filled in the app, the call site is forcing a fill (see step 9). Never describe an icon as outline or solid without checking both the SVG and the rendered usage. - Study siblings first: export 2-3 related existing icons and reuse their metrics instead of inventing proportions.