Jump to content

SVG Export: stroke and fill instead of style?

Recommended Posts

Hi, I'm evaluating AD for creating SVG files in a specific format, required by an internal software.

What I see so far in the exported SVG is ok. But instead of getting the formatting in the style attribute

<rect id=":24W16" x="261.857" y="244.422" width="26.47" height="30.95" style="fill:#c4d8f9;"/>

I would prefer to get stroke and fill like this (result of another software with it's own quirks)

<rect x="259" y="214" width="32.5" height="38" transform="matrix(1,0,0,1,0,0)" id=":24W16" fill="rgb(196,216,249)"/>

Any export options that allow for this that I haven't found yet?


Background: the SVG will be loaded into a HTML page and custom CSS will get applied to the SVG. The inline style in the SVG has highest priority and overrules what's in the CSS.
Yes, there is a workaround by making everything in the CSS !important but that is a dirty hack that I'd like to avoid.

Affinity Designer is the last in a long list of vector editors I'm trying, saving as SVG seems always a bad compromise, sigh :-(



Share this post

Link to post
Share on other sites

Hi Jens,

Welcome to the forums :)

As far as I'm aware there is no way to change this I'm afraid.



Share this post

Link to post
Share on other sites

Not that it will make your search for the perfect generator any easier, but you might find this interview with Jon Ferraiolo of interest, particularly his answer to the "Why is the SVG spec so enormous?" question.

Affinity Photo 1.7.3, Affinity Designer 1.7.3, Affinity Publisher 1.7.3; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo & Affinity Designer for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 13.1.2

Share this post

Link to post
Share on other sites

Yeah, please scrap the "style" and replace it with XML attributes. That's rather annoying for webdesigners to add "!important" to override inline styling.

And even more annoying to replace them manually

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.