Drawing every icon in code
Every item and skill icon is procedural SVG drawn to D2 inventory footprints, inside a pure, mock-tested UI kit built before the game existed.

Contents
There are no icon image files. Every item and skill icon is a React component returning SVG: 28 item glyphs and 33 skill glyphs, coloured by rarity and element at render time, drawn to Diablo II's inventory footprints.
Why draw icons in code
Flat 2D icon packs don't provide painted metal, leather and gems at several footprints. Code does, and:
- Scales:
--gr-cellis 38 px, 33 px under 880 px of window height, 29 px under 700; sharp on a 3× phone too - Recolours free: gem glow, medallion background and glyph gradient come from rarity or element
- Small: all item glyphs are one 589-line TSX file
A glyph is a viewBox and a draw function
32 units per inventory cell; draw functions use material names, not colours:
export interface ItemGlyph {
vb: readonly [number, number]
draw: (p: Paint) => ReactNode
}sword: {
vb: [32, 96],
draw: (p) => (
<>
<path d="M16 3 L20.5 11 L20.5 60 L16 63.5 L11.5 60 L11.5 11 Z" fill={p.steel} />
<path d="M16 5 L19.3 11.3 L19.3 59.4 L16 62 Z" fill={p.highlight} stroke="none" opacity={0.45} />
<path d="M16 13 V56" stroke="rgba(0,0,0,.45)" strokeWidth={1.4} />
<path d="M3 63 Q3 59.5 6.5 59.5 L25.5 59.5 Q29 59.5 29 63 Q29 66.5 25.5 66.5 L6.5 66.5 Q3 66.5 3 63 Z" fill={p.gold} />
<circle cx={16} cy={63} r={2.2} fill={p.gem} />
<rect x={13} y={66.5} width={6} height={16.5} rx={1.5} fill={p.leather} />
{/* grip wraps and pommel */}
</>
),
},- Each material is a gradient in the icon's own
<defs>, ids fromuseIdso a hundred icons don't collide - Steel: cool three-stop; gold: cream to bronze and back; gem: radial in the rarity's two colours
- A wrapping
<g>gives every path the same near-black 1.3-unit outline, the inked look - The
ghostpaint (faint transparent gold) draws the equipment doll's empty-slot outlines from the same glyphs

unknown, the fallback. The bottom row is the endgame's gems and runes, which have their own component. Gems change shape by grade, and each rune shows its initial carved into a stone.Footprints, not squares
| Footprint | Bases | Examples |
|---|---|---|
| 2×3 | 36 | body armor, big shields, crossbows |
| 2×2 | 28 | helms, gloves, boots, buckler |
| 2×4 | 16 | greatswords, greataxes, long bows |
| 1×3 | 12 | short swords, hand axes, clubs |
| 1×2 | 12 | daggers, wands, orbs |
| 2×1 | 8 | belts |
| 1×4 | 4 | staves |
| 1×1 | 2 | ring, amulet |
Glyphs never stretch: a 1×3 sword in a 2×3 Kingsblade cell stays centred at its own width.

The fuzzy resolver
Data authors write an iconKey like item_kite_shield; one resolver, shared by items and skills, maps it to a glyph:
const resolve = (k: string): K => {
const tokens = k.split(/[^a-z0-9]+/).filter(Boolean)
for (let i = 0; i < tokens.length; i++) {
const hit = lookup(tokens.slice(i).join('_'))
if (hit !== undefined) return hit
}
for (let i = tokens.length - 1; i >= 0; i--) {
const hit = lookup(tokens[i] ?? '')
if (hit !== undefined) return hit
}
for (const t of tokens) {
const w = weak[t]
if (w !== undefined) return w
}
return keys.find((g) => g !== fallback && k.includes(g)) ?? fallback
}- Longest suffix that's a key or alias (
heart_of_winter,of_winter,winter) - Single tokens, last first: the noun usually comes last
- Weak tokens like
potion, which lose to specific siblings - Substrings, then
unknown; cached per key
Aliases cover lore names: kingsblade, oathcleaver, zweihander → sword; cudgel, morning_star → mace; cowl → helm; eye → orb; ledger → tome. The ui.md rule: add an alias, not a glyph, when a new id doesn't resolve.
iconKey |
Glyph | Resolved by |
|---|---|---|
item_leather_gloves |
gloves | longest suffix (gloves is a key) |
item_kite_shield |
shield | longest suffix |
item_zweihander |
sword | alias |
item_spire_aegis |
shield | alias on the suffix aegis |
item_heart_of_the_lantern |
orb | alias on the whole suffix, before the token lantern |
item_lantern_of_saint_vey |
lantern | single token, last first (vey, saint, of, lantern) |
item_mana_potion_2 |
potion_blue | single token mana beats the weak token potion |
skill_heart_of_winter |
snowflake | alias on a suffix |
skill_rain_of_barbs |
multishot | alias on a suffix |
A silent fallback needs a loud check: a test that resolves every iconKey in ALL_BASES and every skill icon and fails on unknown is a few lines, since the resolver is pure.
Skill medallions
64×64: element-coloured radial background, dotted ring, the glyph drawn twice (blurred glow, then sharp), glass sheen:
<g filter={`url(#${id('blur')})`} opacity=".85" stroke={gd} strokeWidth="1.2">
{glyph.draw({ ...paint, f: gd, c: gm, s: gd })}
</g>
<g stroke={outline} strokeWidth="1.3" strokeLinejoin="round">
{glyph.draw(paint)}
</g>Each element has a six-colour palette; skills can override a glyph's default element. Locked = CSS grayscale at 45% brightness.

SkillIcon. Look closely and you'll see repeats: Firebolt and Fireball, Shield Bash and Shieldbreaker, Barbed and Seeker Arrow.The limitation is repeats:
- 54 skills → 30 glyphs (
aurais Steel Discipline, Hallowed Ground and Conduit;barrieris Iron Skin, Aegis of Saint Vey and Rime Ward) - 118 bases → 17 glyphs; all 12 swords are one drawing at different footprints
The UI kit, built before the game
Kit components are pure: view models in, callbacks out, no store, network or engine imports. ui.md is the contract.
/dev/uirenders the whole HUD on mock data: sheet, inventory, stash, vendor, skill tree, quest log, waypoints, chat, minimap, orbs, belt, death screen, level-up toast- The
connectedscene drives the realGameHudwithdev/localSim.ts, a fake server reducer on real shared code (inventory moves, stat derivation, vendor stock) - Pure adapters (
itemToUi,skillTabsFor,hudFromSheet…) map the server sheet to view models, with unit tests inbun test src/game/ui

Materials, not flat fills
Every surface gets a gradient, noise, inner shadow and brass border. The panel frame is five 1 px box-shadow rings:
box-shadow:
0 0 0 1px #000,
0 0 0 2px #5a4526,
0 0 0 3px #b8914f,
0 0 0 4px #3b2c17,
0 0 0 5px #000,
inset 0 0 0 1px rgba(0, 0, 0, 0.9),
inset 0 0 0 2px rgba(255, 214, 150, 0.07),
inset 0 0 50px rgba(0, 0, 0, 0.75),
0 24px 60px -10px rgba(0, 0, 0, 0.85),
0 0 90px rgba(0, 0, 0, 0.5);game.css: ~1,900 lines, 256 .gr-* rules. The kit: 51 components, ~12,000 lines of TSX.
No per-frame React: orb levels are CSS-transitioned transforms with a keyframed SVG wave, hotbar cooldowns a conic gradient. Taking damage is one style write.

Type and voice
- Cinzel 700–900: titles, item names, labels, buttons; uppercase, wide tracking, gold gradient
- Alegreya Sans: body, stats, chat, with tabular numerals; flavour text in italic unique-tan
- Copy: in-world and terse; Title Case for names; short verbs ("Rise in town", "Deposit", "Sell"); plain system lines ("Not enough mana"); no exclamation marks, no emoji, no eyebrows, no periods on headings

Parametric glyphs
Next: one sword draw function with blade length, guard and pommel picked by a hash of the base id, the way procgen picks props from a seed. 118 distinct silhouettes, same visual language, zero asset cost.