Modern Image and Icon Assets
suggest changeRaster sprite sheets combined many small images into one request. That optimization is usually unnecessary with HTTP/2 or HTTP/3 and makes responsive sizing, high-density rendering, maintenance, and accessibility harder.
Prefer:
- inline or external SVG for scalable interface icons;
- an SVG symbol sprite when many icons should share one file;
- responsive images with
srcset,sizes, andpicturefor photographs; - modern image formats selected according to project requirements;
- CSS gradients and shapes for simple decoration.
An SVG icon can inherit the surrounding text color:
.icon {
inline-size: 1em;
block-size: 1em;
fill: currentColor;
flex: none;
}
Decorative icons should be hidden from assistive technology. Meaningful icons need an accessible name, often best supplied by visible text in the associated control.
Raster sprites remain useful in specialized cases such as frame-by-frame bitmap animation or a constrained legacy asset pipeline. Treat them as a deliberate tradeoff rather than a default web-performance technique.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents