Skip to content

v1.5.0

Choose a tag to compare

@github-actions github-actions released this 07 Aug 11:35
00a2911

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.