SVG Export missing data-attributes in 27.1
macOS Ventura 13.1
Illustrator 27.1
Export for Screens
Choose SVG format
Edit Format Settings for SVG (by clicking on gear icon)
Select SVG and set to the following:
Styling: Inline Style
Font: SVG
Images: Preserve
Object IDs: Unique
Decimal: 2
check both Minify and Responsive
The exported SVG should have the attribute data-name with the object's layer name. For example, a rectangle object filled with the color #f6b780 with the layer named 0006A should look like this in the SVG file.
<rect id="bddec359-1a3b-4c18-8500-9c0518f1a41d" data-name="0006A" x="1374.25" y="603.67" width="232.52" height="83.75" style="fill:#f6b780"/>
Instead the code is rendering like this when exported from Illustrator 27.1:
<rect id="uuid-b659132c-b20b-4f7a-a072-77b8809c18f2" x="1374.25" y="603.67" width="232.52" height="83.75" style="fill:#f6b780;"/>
It's also exporting with the XML tag before the SVG tag:
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2250 1680">
It should not be exporting with the XML tag.