How do I define or reference a variable in SVG?

后端 未结 3 616
感情败类
感情败类 2021-01-04 01:38

Might be you do not need variables for static images but this would be easier to inspect them and see related parts when everything is defined in terms of variables, IMO. It

3条回答
  •  我在风中等你
    2021-01-04 01:53

    The simple answer is no.

    You can define some things such as gradients, masks, patterns and filters relative to the object they are being applied to. You can also define some elements relative to the size of the parent SVG. However you can't define the shape of one element relative to another element. There is no such thing as variables in SVG.

    What you can do is dynamically generate (or modify) an SVG using Javascript.

提交回复
热议问题