Changing SVG icon color using css or js


is it possible to use a single SVG icon for a node, and change its color depending on an attribute,
either via js or via css “webkit-mask-image” attribute.
currently we need to create different images for different colors.

Yes, this should be possible. Have you seen our SVG Icons sample?

You’ll need to handle color (fill) within your nodeTemplate (GoJS) – CSS will not change anything in the canvas. The sample I linked should show you how to do that.