Download Latest Version v1.7.0 source code.zip (523.6 kB)
Email in envelope

Get an email when there's a new version of Morphicons

Home / v1.5.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-08-07 1.6 kB
v1.5.0 source code.tar.gz 2026-08-07 384.2 kB
v1.5.0 source code.zip 2026-08-07 452.6 kB
Totals: 3 Items   838.5 kB 0

Added

  • morphicons/adapters — format adapters, one opt-in entry. The core keeps exactly two structural contracts (IconInput in, PathEl out) and never grows toward a foreign format: everything else enters through this entry, where each adapter is an independent module pinned as tree-shakeable by per-export size gates. Core, dom and the four bindings are byte-identical to 1.4.2. Adapters are per format, never per vendor. Two adapters ship:
  • svgToIcon(markup) — SVG markup in: an Iconify body from @iconify-json/*, a full <svg>, a copy-pasted <path>. Strips non-rendered containers (defs/mask/clipPath/symbol), rejects what can't honestly morph (fill-drawn icons, transforms, elements outside the seven stroke primitives) with clear parse-time errors, and auto-fits onto the 24 grid when the markup carries a viewBox. 3.34 KB gzip standalone; ~0.4 KB incremental next to the core.
  • maskTarget(el, opts?) — CSS-mask elements out (the UnoCSS presetIcons / @iconify/tailwind model: mask-image on a <span>, no <path> in the DOM). Drives the element through a hidden pair of referenced <svg><mask><path> buffers, flipping mask-image between them on every write: a data-URI mask per frame never decodes in time in Chromium (blank flight) and WebKit doesn't repaint when a referenced mask's content mutates (frozen flight in Safari), so the double buffer forces re-resolution in every engine. Verified by eye in Chrome and Safari. Returns the driver's write contract plus dispose(); compose with createMorph(maskTarget(el), icon). 0.70 KB gzip standalone.
Source: README.md, updated 2026-08-07