惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园_首页
Last Week in AI
Last Week in AI
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
WordPress大学
WordPress大学
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
The Cloudflare Blog
罗磊的独立博客
月光博客
月光博客
N
Netflix TechBlog - Medium
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
Jina AI
Jina AI
J
Java Code Geeks

Lynn Fisher

How I remember link and image Markdown syntax Case Study: lynnandtonic.com 2025 refresh Blog Questions Challenge 2025 Ten years of A Single Div When your work disappears I archived my tweets Case Study: lynnandtonic.com 2023 refresh A decade of working remotely The nbsp; was breaking after all Put your name on it Unordered, incomplete list of things I want from a job Case Study: lynnandtonic.com 2022 refresh Some things I worked on at Netlify Fun CSS-only scrolling effects for Matterday Case Study: lynnandtonic.com 2021 refresh
SVG export wishlist
Lynn Fisher · 2024-01-27 · via Lynn Fisher

Lately for work and for my portfolio, I’ve been making complex SVG illustrations that require a lot of fine-grained control once implemented. Colors change, layers show and hide, and animations run based on various user input.

A tedious part of that process has been prepping the SVG after exporting it from Illustrator. Some things are updated manually, some with the RegReplace plugin in Sublime Text, and some with optimization tools like SVGO.

It would be cool and useful if some of this work could happen when the SVG is initially exported. I know it’s a forever problem making design software’s output more closely resemble developers’ output, but SVG is already there! Just a few more export controls would be a big win, imo.

So here’s a list of options I would love to see:

1. Export layer names as classes.
Illustrator only supports exporting layer names as id. And then to avoid multiples of the same id, Illustrator will do this:

  <path id="card">...</path>
  <path id="card-1" data-name="card">...</path>
  <path id="card-2" data-name="card">...</path>

This requires some find-and-replace that takes a couple steps. I’d much prefer it output like this:

  <path class="card">...</path>
  <path class="card">...</path>
  <path class="card">...</path>

2. Namespaced output.
If we’re doing classes, it might also be cool if we could namespace things. Using the artboard name + layer name makes sense here. Maybe it could output like this:

  <svg id="birthday">
    <path class="card birthday-card">...</path>
    <path class="byline birthday-byline">...</path>
  </svg>

Or maybe just like this:

  <svg id="birthday">
    <path class="birthday-card">...</path>
    <path class="birthday-byline">...</path>
  </svg>

3. Export with CSS custom properties.
The most obvious case here is theming like light and dark modes. Instead of hex colors, I often want fill and stroke to be something like var(--bg-color) or var(--text-color). Or currentColor would be great sometimes, too.

Maybe color swatches could have one more setting for a custom property name and the SVG export could toggle that on or off.

4. Add <title> and <description> at artboard level.
Illustrator lets you add them at document level, but not artboard. And at least for my workflow, I really don’t want to maintain multiple files of source artwork.

5. Optimize on export.
An SVGO integration or something similar makes sense here. Would be great if it was a bit smart. So if you’ve set a <title> for your artboard, the option to strip out the <title> would be unselected automatically, etc.

6. Set custom width and height.
Illustrator does have a checkbox to export a responsive SVG, but this actually removes the width and height attributes. I usually want to set them to 100%.

7. Toggle other SVG properties.
Not as common a need, but might be nice to add things like preserveAspectRatio or vector-effect with a checkbox on export.

🙏 🙏 🙏

Having these options would rule and make my work a lot easier.

I know Figma has plugins that help with some of these. SVG Export provides a way to do currentColor and to export with layer names as classes. Nice. Advanced SVG Export uses SVGO to optimize on export. Also nice!

But to be honest, doing vector work in Figma is extremely not fun for me! Maybe someday. In the meantime, Adobe, let’s do this.