Published at
Updated at
Reading time
1min
This post is part of my Today I learned series in which I share all my web development learnings.

Today I discovered the caniuse.com entry for vector-effect: non-scaling-stroke. Using vector-effect you can control if transformation such as scale should be applied to the stroke width. Fancy!

If you define vector-effect="non-scaling-stroke" you can guarantee that the stroke width stays the same no matter if transformations are applied. This functionality can be useful when you're building interactive SVG animations.

Learn more about it by playing with the demo below. Change the scale value and find that the stroke width scales on the x and y axis, too. Change vector-effect to non-scaling-stroke and see that the stroke width stays the same. 💪

Read more about vector-effect on MDN. Have fun and happy scaling!

If you enjoyed this article...

Join 5.5k readers and learn something new every week with Web Weekly.

Web Weekly — Your friendly Web Dev newsletter
Reply to this post and share your thoughts via good old email.
Stefan standing in the park in front of a green background

About Stefan Judis

Frontend nerd with over ten years of experience, freelance dev, "Today I Learned" blogger, conference speaker, and Open Source maintainer.

Related Topics

Related Articles