Apply `vector-effect: non-scaling-stroke` for all SVG elements by default?

I'm grasping at straws here, but is it possible to set SVG elements to not scale their strokes by default?
It's tedious having to do this all the time for every element in every SVG :frowning:

Also, can someone tell me why applying this to the root element style doesn't affect its children?

1 Like

vector-effect is not a style, but a svg attribute.
Most svg attributes can be defined with styles too, so does vector-effect.
But almost no attributes have any effect on its children.
Also you cant apply it as a style to the svg

You could however add
path{vector-effect:non-scaling-stroke} or svg * {vector-effect:non-scaling-stroke} to your stylesheet
or if you dont want to break all svgs:

.psc-YourClass * {vector-effect:non-scaling-stroke}
2 Likes