Maxim Mironjuk
-
March 20, 2026
Anyone who copies every icon as a full inline SVG into each phtml template in a Hyvä theme bloats the DOM unnecessarily and makes later changes to the icon set harder. SVG icon sprites solve this problem by defining every icon shape only once and reusing it across as many places in the theme as needed through a simple reference. This article shows how to build, optimize, generate and accessibly wire up SVG icon sprites in a Hyvä theme, including a concrete Node build script, an SVGO configuration and a reusable icon partial.