使用 Inkscape 将外部 CSS 类样式嵌入到 SVG 元素中

问题描述

我使用 Inkscape 来编辑现有的 SVG 文件,像这样(为了可读性而简化):

<svg>
<style type="text/css">
    .st0{fill:#AFAA96;stroke:#AFAA96;stroke-miterlimit:10;}
    .st1{fill:none;stroke:#738282;stroke-width:16;stroke-miterlimit:10;}
</style>
<rect x="0.5" y="0.5" class="st0" width="99" height="99"/>
<path class="st1" d="M10 10"/>
</svg>

如您所见,有 2 个 css 类“st0”和“st1”,分别应用于 <rect><path>

我不希望 SVG 包含 CSS 类。

我需要每个 SVG 元素都包含相关类的所有相应样式。

有没有办法使用 Inkscape 将(自动)以前的 SVG 转换成这个?

<svg>
  <rect x="0.5" y="0.5" width="99" height="99" fill="#AFAA96" stroke="#AFAA96" stroke-miterlimit="10"/>
  <path fill="none" stroke="#738282" stroke-width="16" stroke-miterlimit="10" d="M10 10"/>
</svg>

提前谢谢你:)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)