Skip to main content
New Participant
April 16, 2024
Answered

SVG export is now adding "stroke-width: 0px;"

  • April 16, 2024
  • 2 replies
  • 930 views

Situation

let take a simple square, no stroke:

 

In older versions of illustrator (example v27) it exports this

<?xml version="1.0" encoding="UTF-8"?>
<svg id="uuid-6ba987cb-39fb-40cd-98de-d8b109dabf06" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 720">
  <g id="uuid-4f72d452-3eef-4411-a3a5-dacea231604c" data-name="red square 27">
    <rect width="720" height="720" style="fill: #ed1c24;"/>
  </g>
</svg>

 with no information on the stroke

 

and with v28.4.1 it now does this

<?xml version="1.0" encoding="UTF-8"?>
<svg id="uuid-9197d4b2-a83e-462e-a5ec-8eed0be30063" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 720">
  <g id="uuid-684f80f4-6e08-4bfc-90da-cd37ceef13b5" data-name="red square 28">
    <rect width="720" height="720" style="fill: #ed1c24; stroke-width: 0px;"/>
  </g>
</svg>

with the "stroke-width: 0px;" added to the style.

 

Problem

Why is this needed? no stroke style is the same as stroke 0, right? There's 1000s of information that are exported because they are "0", no need to add them.

Was this intentionally added to solve something that I don't know?

Is there a way to say to Illustrator to "not add this information" to the export?

This became a problem to us since we were targeting the stroke's style (and adding, animating it), and this basically because and unexpected hurdle.

This topic has been closed for replies.
Correct answer Doug A Roberts

Has there been any update to this issue?


It's fixed in the current Beta (28.6 578). fill: #000 is also removed.

2 replies

New Participant
May 21, 2024

The "new" svg export is giving us some trouble as well. We need to export without a fill color since we are coloring our icons through css. Before the update the svg was exported without a fill attribute when colored completely in black. Now illustrator adds a fill attribute which makes our icon creation process 1 step longer (we need to open the newly created svg file in notepad and remove the stroke with=0 and the fill=000). What is the reason for this change? Why add unneccessary code?

Community Manager
May 21, 2024

Hello @defaultz306qicmv5ze, @LeQuest Adobe2,

Thank you for your patience. I have shared your observations with the product team, and they are currently investigating the issue. I will update this thread with more details as they become available.

In the meantime, the only workaround is to roll back to a previous version of Illustrator (https://adobe.ly/3V7ZNxx). I understand this is not ideal, and I apologize for the inconvenience.

If you have any further questions or need assistance, please feel free to reach out. We're here to help.


Thanks,
Anubhav

New Participant
June 4, 2024

Has there been any update to this issue?

Doug A Roberts
Community Expert
April 16, 2024

Are you using Export As or Save As? What exact export settings are you using?

New Participant
April 23, 2024

 

We're using Asset Export. These are the settings: