Please allow currentColor for SVG export
Using SVG in web development frequently requires manual editing of the svg code, to use currentColor instead of a fixed fill or stroke colour.
-
I can’t :) The team can, probably, some times in future. After all, you are the one who asked for this, and so far, it’s two votes only.
The team is looking into supporting CSS custom parameters, on export only, that does allow defining color swatches which can get updated in CSS even after export. However, those are early ideas. -
Stephan Mönninghoff commented
Thanks for your reply, Egor, and thanks for suggesting a workaround. I still cannot quite understand why you cannot provide me with an export option that will replace both stroke colour and fill colour with the currentColor value. Google has introduced this feature for their icons. So, when copying svg code from their website, you can set the fill to currentColor. Their icons have no strokes but I don't think Adobe should worry too much about how many disadvantages there are to using currentColor, if this is what will solve a big roadblock in using SVGs from Illustrator in webdesign.
-
Stephan, I didn’t mean it works already.
The team has responded on this:
'currentColor is one way to solve it but has many disadvantages. One is that it can only get defined once per subtree (it is inherited). So one can not define a fill color and a stroke color separately. For that, CSS has custom properties. Supporting custom properties is a challenge though — not on export but on import.'So I suppose editing SVGs after exporting with a custom scripted routine stays the only viable way to assign currentColor.
After all, SVG is not native format for Ai.
But this can be achieved with Inkscape though. You can find manuals on the method on web, like this one: https://inkscape.org/de/forums/questions/using-currentcolor-in-inkscape/ -
Stephan Mönninghoff commented
I tried a spot colour but that did not work. (I named it 'currentColor'). There is a Registration colour. Why not a currentColor as well?
-
Interesting, yes. But how do you imagine this to work within the current paradigm? A special swatch that makes no sense for anything but SVGs? An attribute one can assign in the Attributes panel? An effect?