Menu

1 / 2

Will Your SVG Sprite Survive Print Preview?

DEV Community: html·Axialis Software·about 7 hours ago
#rfByo9DQ
#devto2#devto#dev#status#header
Long article (369 words) — no AI summary yet.
Reading 0:00
15s threshold

An inspection dashboard has a header, two status icons, and a print stylesheet that hides the header. The sprite that defines both icons happens to live inside that header. Do the checkmark and warning triangle still make it into the PDF?

In a test with Chromium 145.0.7632.6, both icons printed. Moving the sprite out of the header produced a PDF with the same visible output.

Same report, two sprite locations

The two report rows read “Seal integrity · Approved” and “Pressure log · Needs review.” Each row has an SVG that points to a symbol in the same HTML document. The checkmark uses this reference.

<svg viewBox = "0 0 24 24" aria-hidden = "true" > <use href = "#status-approved" ></use> </svg>

Enter fullscreen mode

Exit fullscreen mode

In the first HTML file, the zero-size sprite lives inside the header. In the second, it sits directly under <body> .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.