Open taylornowotny opened 2 years ago
That's a very interesting task. Essentially the problem is that svgs often come exported with a predefined color instead of using currentColor and we want to give user a UI to modify the SVG without actually having to touch svg's XML by hand.
We need to think of all situations where this is needed, because its not just fill property, there is also stroke and we probably need a way to visually select the paths we want to modify, because what if the SVG is a colorful icon and you want to set the fill or stroke only on a certain path?
We may need to look at this problem holistically.
In addition to that currentColor won't work if svg is rendered on the canvas as an img tag or background image. It has to be rendered as an SVG document inside HTML, which means we also need an SVG component or alternatively generic code component that would allow that.
As of right now anyone can do this by opening the SVG file and replacing the fill/stroke with currentColor inside it's XML and then pasting it into a code embed, though this is probably intimidating to majority of visual developrs/designers.
There's often a need to change the fill color of a single-color icon. For example, for a hover effect or to allow the same icon asset to be used across the site in different color situations.
Webflow users often paste the SVG code of icons in a code embed element, making sure the
fill="currentColor"
. That enables them to change the color of the icon using the font color in the style panel.Is there a way a Webstudio user could be able to change the color fill of (single-color) icons natively?
UX possibilities:
fill="currentColor"
. (maybe labeled "control fill color with font color")