Re: Spritesheets & viewBoxes

Peter Nowell
Jan 18, 2017 · 1 min read

I’m using embedded SVG spritesheets in several projects currently, and they’re working well. Here are several resources that might help with the implementation:


Regarding bounding boxes and Adobe Illustrator SVG export, both Sketch and AI have various little quirks in how they write SVG. Sketch, however, recently released an update that prevents this issue; it’s now much smarter at extending the SVG bounding box (“viewBox”) to the edge of your layers. But—at least in Sketch—this should only be an issue when you aren’t using and exporting an Artboard.

I always recommend creating an Artboard around any design that you export as SVG. In Sketch, you can then export the Artboard itself, rather than the whole file or certain layers, and the resulting SVG will adhere to the dimensions of that Artboard. So no layers get cropped out unless you explicitly want them to.

    Peter Nowell

    Written by

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade