Skip to content
Product and web UIguide

How to cap icon art that grows with the viewport

By SkeuDesign Editorial Team1 min read

Answer in brief

Use clamp() for a fluid icon that needs a minimum and maximum width. Choose the endpoints from actual layouts where the art must remain legible and leave room for text.

Size a feature illustration

With clamp(48px, 8vw, 96px), a 400-pixel viewport uses the 48-pixel floor. A 900-pixel viewport yields 72 pixels. Check the adjacent heading at both ends with the longest product name.

Check intermediate widths numerically

For the 48-to-96-pixel example, the fluid value reaches its lower bound at a 600-pixel viewport and its upper bound at 1200 pixels. Test just inside those values. A sudden jump in width suggests a separate media rule, a competing max-width or a different containing layout.

Sources

  1. [1] clamp() CSS function - CSS — MDN Web Docs, accessed November 23, 2026

Frequently asked questions

Does clamp change the downloaded image?

It controls a CSS dimension. Supply appropriate image candidates separately if transfer size also needs to vary.