How to preserve SVG stroke width when an icon scales
Answer in brief
Apply vector-effect="non-scaling-stroke" to a stroked shape when its outline must retain a consistent weight as its geometry scales. Compare the result across the actual UI sizes.
Check an expandable map pin
Show the same pin at a compact and expanded map zoom. Measure the outline in both states and inspect tight corners, where a fixed-width stroke may crowd the inner opening at small sizes.
Compare the inside gap at both extremes
A stroke that stays two pixels wide can dominate a tiny symbol. At its smallest size, check whether the opening in the pin still admits a clear patch of background. If the opening closes, use a simplified small variant or a thinner stroke at that size while retaining the scalable geometry elsewhere.
Sources
- [1] vector-effect - SVG — MDN Web Docs, accessed November 23, 2026
Frequently asked questions
Will this keep the entire pin the same size?
The geometry still scales. The effect changes how the stroke's width responds to the transformation.