Subject: Re: bug#77841: Some svg image's black color is replaced by emacs's theme foreground color

From: Alan Third <[email-masked]>
Date: Sat, 3 May 2025 17:34:22 +0100

On Sat, May 03, 2025 at 03:39:22PM +0000, Ihor Radchenko wrote:
> 
> Alan Third <[email-masked]> writes:
> > Does anyone know anything about "CurrentColor" in CSS? I'm wondering
> > if that's our solution...
> 
> I do not know much, but from quick googling:
> https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#currentcolor_keyword

As far as I an tell the attached patch works for anything that comes
with Emacs itself. It may break any third-party SVG files used as
widgets, or just relying on the fill colour being set. I don't think
there's anything we can do about that if we want to change this
behaviour.

I don't know if anyone is actually using SVG files in that way, so
this may not be a real concern. I'd still suggest we probably want to
discuss this in Emacs devel to get it a little more visibility before
pushing it.

Needs documentation and news entry. But lets see if this actually
works for everyone first.
-- 
Alan Third
From 64bd6628b40cc1e3f8dd3c7e6125e2373a73735e Mon Sep 17 00:00:00 2001
From: Alan Third <[email-masked]>
Date: Sat, 3 May 2025 17:21:13 +0100
Subject: [PATCH] Change foreground color handling for SVG files (bug#77841)

* etc/images/checkbox-mixed.svg:
* etc/images/checked.svg:
* etc/images/conceal.svg:
* etc/images/down.svg:
* etc/images/gnus/gnus-pointer.svg:
* etc/images/left.svg:
* etc/images/outline-close.svg:
* etc/images/outline-open.svg:
* etc/images/radio-checked.svg:
* etc/images/radio-mixed.svg:
* etc/images/radio.svg:
* etc/images/reveal.svg:
* etc/images/right.svg:
* etc/images/symbols/check-mark_16.svg:
* etc/images/symbols/chevron_down_16.svg:
* etc/images/symbols/chevron_left_16.svg:
* etc/images/symbols/chevron_right_16.svg:
* etc/images/symbols/chevron_up_16.svg:
* etc/images/symbols/cross_16.svg:
* etc/images/symbols/cross_circle_16.svg:
* etc/images/symbols/cross_circle_fill_16.svg:
* etc/images/symbols/dot_large_16.svg:
* etc/images/symbols/dot_medium_16.svg:
* etc/images/symbols/dot_small_16.svg:
* etc/images/symbols/heart_16.svg:
* etc/images/symbols/heart_fill_16.svg:
* etc/images/symbols/heart_half_16.svg:
* etc/images/symbols/menu_16.svg:
* etc/images/symbols/minus_16.svg:
* etc/images/symbols/minus_circle_16.svg:
* etc/images/symbols/minus_circle_fill_16.svg:
* etc/images/symbols/plus_16.svg:
* etc/images/symbols/plus_circle_16.svg:
* etc/images/symbols/plus_circle_fill_16.svg:
* etc/images/symbols/star_16.svg:
* etc/images/symbols/star_fill_16.svg:
* etc/images/symbols/star_half_16.svg:
* etc/images/unchecked.svg:
* etc/images/up.svg: Set 'fill' color to 'currentcolor'.
* etc/images/symbols/README: Add explanation of change to instructions.
* src/image.c: Remove setting of the 'fill' color in the default SVG
stylesheet.
---
 etc/images/checkbox-mixed.svg               | 5 +++++
 etc/images/checked.svg                      | 5 +++++
 etc/images/conceal.svg                      | 7 ++++++-
 etc/images/down.svg                         | 5 +++++
 etc/images/gnus/gnus-pointer.svg            | 2 +-
 etc/images/left.svg                         | 5 +++++
 etc/images/outline-close.svg                | 5 +++++
 etc/images/outline-open.svg                 | 5 +++++
 etc/images/radio-checked.svg                | 5 +++++
 etc/images/radio-mixed.svg                  | 5 +++++
 etc/images/radio.svg                        | 5 +++++
 etc/images/reveal.svg                       | 5 +++++
 etc/images/right.svg                        | 5 +++++
 etc/images/symbols/README                   | 9 +++++++++
 etc/images/symbols/check-mark_16.svg        | 1 +
 etc/images/symbols/chevron_down_16.svg      | 1 +
 etc/images/symbols/chevron_left_16.svg      | 1 +
 etc/images/symbols/chevron_right_16.svg     | 1 +
 etc/images/symbols/chevron_up_16.svg        | 1 +
 etc/images/symbols/cross_16.svg             | 1 +
 etc/images/symbols/cross_circle_16.svg      | 1 +
 etc/images/symbols/cross_circle_fill_16.svg | 1 +
 etc/images/symbols/dot_large_16.svg         | 1 +
 etc/images/symbols/dot_medium_16.svg        | 1 +
 etc/images/symbols/dot_small_16.svg         | 1 +
 etc/images/symbols/heart_16.svg             | 1 +
 etc/images/symbols/heart_fill_16.svg        | 1 +
 etc/images/symbols/heart_half_16.svg        | 1 +
 etc/images/symbols/menu_16.svg              | 1 +
 etc/images/symbols/minus_16.svg             | 1 +
 etc/images/symbols/minus_circle_16.svg      | 1 +
 etc/images/symbols/minus_circle_fill_16.svg | 1 +
 etc/images/symbols/plus_16.svg              | 1 +
 etc/images/symbols/plus_circle_16.svg       | 1 +
 etc/images/symbols/plus_circle_fill_16.svg  | 1 +
 etc/images/symbols/star_16.svg              | 1 +
 etc/images/symbols/star_fill_16.svg         | 1 +
 etc/images/symbols/star_half_16.svg         | 1 +
 etc/images/unchecked.svg                    | 5 +++++
 etc/images/up.svg                           | 5 +++++
 src/image.c                                 | 2 +-
 41 files changed, 106 insertions(+), 3 deletions(-)

diff --git a/etc/images/checkbox-mixed.svg b/etc/images/checkbox-mixed.svg
index 6e46b803c81..b19a04c2648 100644
--- a/etc/images/checkbox-mixed.svg
+++ b/etc/images/checkbox-mixed.svg
@@ -1,4 +1,9 @@
 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 16 16">
+  <style>
+    svg {
+      fill: currentColor;
+    }
+  </style>
   <g>
     <path d="M3.5 1A2.506 2.506 0 0 0 1 3.5v9C1 13.876 2.124 15 3.5 15h9c1.376 0 2.5-1.124 2.5-2.5v-9C15 2.124 13.876 1 12.5 1zm0 1h9c.84 0 1.5 .66 1.5 1.5v9c0 .84-.66 1.5-1.5 1.5h-9c-.84 0-1.5-.66-1.5-1.5v-9C2 2.66 2.66 2 3.5 2z" overflow="visible" />
     <path d="M5 6a2 2 0 1 0 0 4h6a2 2 0 1 0 0 -4z" overflow="visible" />
diff --git a/etc/images/checked.svg b/etc/images/checked.svg
index 4cbdef04f25..72d589a2e12 100644
--- a/etc/images/checked.svg
+++ b/etc/images/checked.svg
@@ -1,4 +1,9 @@
 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 16 16">
+  <style>
+    svg {
+      fill: currentColor;
+    }
+  </style>
   <g>
     <path d="M3.5 1A2.506 2.506 0 0 0 1 3.5v9C1 13.876 2.124 15 3.5 15h9c1.376 0 2.5-1.124 2.5-2.5v-9C15 2.124 13.876 1 12.5 1zm0 1h9c.84 0 1.5 .66 1.5 1.5v9c0 .84-.66 1.5-1.5 1.5h-9c-.84 0-1.5-.66-1.5-1.5v-9C2 2.66 2.66 2 3.5 2z" overflow="visible" />
     <path d="M14.5 3l-.5-.5L7.5 9 5 6.5l-2 2L7.5 13l7-7z" overflow="visible" />
diff --git a/etc/images/conceal.svg b/etc/images/conceal.svg
index 65695c0024e..a58e24da70c 100644
--- a/etc/images/conceal.svg
+++ b/etc/images/conceal.svg
@@ -1,4 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
-    <path d="m 1.53125 0.46875 l -1.0625 1.0625 l 14 14 l 1.0625 -1.0625 l -2.382812 -2.382812 c 1.265624 -1.0625 2.171874 -2.496094 2.589843 -4.097657 c -0.914062 -3.523437 -4.097656 -5.984375 -7.738281 -5.988281 c -1.367188 0.011719 -2.707031 0.371094 -3.894531 1.042969 z m 6.46875 3.53125 c 2.210938 0 4 1.789062 4 4 c -0.003906 0.800781 -0.246094 1.578125 -0.699219 2.238281 l -1.46875 -1.46875 c 0.105469 -0.242187 0.164063 -0.503906 0.167969 -0.769531 c 0 -1.105469 -0.894531 -2 -2 -2 c -0.265625 0.003906 -0.527344 0.0625 -0.769531 0.167969 l -1.46875 -1.46875 c 0.660156 -0.453125 1.4375 -0.695313 2.238281 -0.699219 z m -6.144531 0.917969 c -0.753907 0.898437 -1.296875 1.957031 -1.59375 3.09375 c 0.914062 3.523437 4.097656 5.984375 7.738281 5.988281 c 0.855469 -0.007812 1.703125 -0.152344 2.511719 -0.425781 l -1.667969 -1.667969 c -0.277344 0.058594 -0.5625 0.089844 -0.84375 0.09375 c -2.210938 0 -4 -1.789062 -4 -4 c 0.003906 -0.28125 0.035156 -0.566406 0.09375 -0.84375 z m 0 0"/>
+  <style>
+    svg {
+      fill: currentColor;
+    }
+  </style>
+  <path d="m 1.53125 0.46875 l -1.0625 1.0625 l 14 14 l 1.0625 -1.0625 l -2.382812 -2.382812 c 1.265624 -1.0625 2.171874 -2.496094 2.589843 -4.097657 c -0.914062 -3.523437 -4.097656 -5.984375 -7.738281 -5.988281 c -1.367188 0.011719 -2.707031 0.371094 -3.894531 1.042969 z m 6.46875 3.53125 c 2.210938 0 4 1.789062 4 4 c -0.003906 0.800781 -0.246094 1.578125 -0.699219 2.238281 l -1.46875 -1.46875 c 0.105469 -0.242187 0.164063 -0.503906 0.167969 -0.769531 c 0 -1.105469 -0.894531 -2 -2 -2 c -0.265625 0.003906 -0.527344 0.0625 -0.769531 0.167969 l -1.46875 -1.46875 c 0.660156 -0.453125 1.4375 -0.695313 2.238281 -0.699219 z m -6.144531 0.917969 c -0.753907 0.898437 -1.296875 1.957031 -1.59375 3.09375 c 0.914062 3.523437 4.097656 5.984375 7.738281 5.988281 c 0.855469 -0.007812 1.703125 -0.152344 2.511719 -0.425781 l -1.667969 -1.667969 c -0.277344 0.058594 -0.5625 0.089844 -0.84375 0.09375 c -2.210938 0 -4 -1.789062 -4 -4 c 0.003906 -0.28125 0.035156 -0.566406 0.09375 -0.84375 z m 0 0"/>
 </svg>
diff --git a/etc/images/down.svg b/etc/images/down.svg
index 707cd23ea4b..c876c332c28 100644
--- a/etc/images/down.svg
+++ b/etc/images/down.svg
@@ -22,6 +22,11 @@
       </cc:License>
     </rdf:RDF>
   </metadata>
+  <style>
+    svg {
+      fill: currentColor;
+    }
+  </style>
   <title id='title8473'>Gnome Symbolic Icons</title>
   <defs id='defs7386'/>
   <g inkscape:groupmode='layer' id='layer10' inkscape:label='ui' transform='translate(-152.00586,-952)'>
diff --git a/etc/images/gnus/gnus-pointer.svg b/etc/images/gnus/gnus-pointer.svg
index d46c287cfe4..3252c156be4 100644
--- a/etc/images/gnus/gnus-pointer.svg
+++ b/etc/images/gnus/gnus-pointer.svg
@@ -87,7 +87,7 @@
      id="layer1"
      transform="translate(-214.53867,-140.13329)">
     <path
-       style="fill-opacity:1"
+       style="fill-opacity:1; fill: currentcolor"
        d="m 321.70896,253.17911 c -0.36667,-0.36666 -0.67201,-5.20416 -0.67854,-10.75 -0.019,-16.11278 -3.80254,-26.01429 -11.53101,-30.17635 -1.90142,-1.02398 -3.45712,-2.07087 -3.45712,-2.32642 0,-1.43357 10.45296,-16.08056 11.47604,-16.08056 2.47319,0 9.23725,5.87604 10.97182,9.53138 5.03752,10.61578 4.34103,30.55989 -1.50929,43.21862 -3.28874,7.11606 -3.93373,7.9215 -5.2719,6.58333 z m -77.16152,-8.46295 c -4.45468,-3.91126 -4.44465,-5.90837 0.0814,-16.20837 6.498,-14.78751 34.5082,-54.96722 36.7536,-52.72182 1.31908,1.31908 -1.58012,6.7064 -6.9201,12.85902 -5.10867,5.88611 -15.27729,21.00949 -18.79544,27.95371 -3.51862,6.94514 -2.86216,9.83677 2.56492,11.29813 2.18779,0.58911 5.33413,0.77321 6.99187,0.4091 6.2872,-1.3809 18.78154,-10.37638 34.82869,-25.07544 1.63528,-1.49791 2.98143,-2.00796 3.86245,-1.46346 2.11637,1.30799 -7.3484,14.40921 -15.90222,22.01199 -16.20847,14.40636 -27.60611,21.67016 -36.7152,23.39889 -2.68566,0.50969 -3.8489,0.0855 -6.75,-2.46175 z m 106.49485,-47.00332 c -2.5122,-0.71522 -8.01566,-5.45017 -19.5,-16.77699 -12.82987,-12.6539 -16.81552,-16.00934 -20.11602,-16.9353 -9.0949,-2.5516 -16.05869,-0.67634 -18.98403,5.11216 -1.7056,3.37495 -5.29744,7.73307 -6.37338,7.73307 -0.34364,0 -1.1778,-1.5293 -1.8537,-3.39846 -1.42445,-3.93926 -8.55314,-10.8615 -13.72556,-13.32805 -3.4655,-1.65258 -3.70255,-1.63465 -7.9122,0.59856 -2.38681,1.26621 -5.39614,3.78466 -6.68739,5.59656 -2.99038,4.19616 -18.42665,18.22292 -22.26047,20.22784 -3.6871,1.92819 -10.16611,1.16914 -12.83946,-1.5042 -1.25983,-1.25984 -2.63141,-5.30077 -3.84411,-11.32548 -1.03697,-5.15172 -2.08806,-10.26677 -2.33574,-11.36677 -0.24769,-1.1 0.16855,-2.83295 0.92497,-3.85101 1.33079,-1.79111 1.50083,-1.78047 5.25386,0.32885 2.13321,1.19893 4.96021,3.93001 6.28222,6.06908 2.91698,4.71978 6.42385,5.78889 11.14802,3.3986 5.61805,-2.84256 13.87615,-9.63484 17.51425,-14.40546 5.80084,-7.60662 11.27676,-12.99393 13.86896,-13.64453 1.35462,-0.33999 4.82023,0.14973 7.70136,1.08827 4.00736,1.3054 6.38479,2.98928 10.11649,7.16527 l 4.87808,5.45885 1.83587,-3.01884 c 2.46937,-4.06056 10.61011,-8.08908 16.34622,-8.08908 7.64657,0 14.07091,3.70799 23.59667,13.61949 4.6942,4.88428 9.67621,10.28189 11.07114,11.99468 9.1173,11.19486 23.8278,13.70046 29.6705,5.0537 1.25211,-1.85302 3.42939,-4.44884 4.83841,-5.7685 l 2.56185,-2.39937 -0.72231,3.87057 c -1.32367,7.09295 -6.50404,19.06241 -9.26864,21.41558 -8.2221,6.99849 -14.31844,9.03606 -21.18586,7.08091 z"
        id="path1" />
   </g>
diff --git a/etc/images/left.svg b/etc/images/left.svg
index 893515d2dfd..b6fe3421ac1 100644
--- a/etc/images/left.svg
+++ b/etc/images/left.svg
@@ -22,6 +22,11 @@
       </cc:License>
     </rdf:RDF>
   </metadata>
+  <style>
+    svg {
+      fill: currentColor;
+    }
+  </style>
   <title id='title8473'>Gnome Symbolic Icons</title>
   <defs id='defs7386'/>
   <g inkscape:groupmode='layer' id='layer10' inkscape:label='ui' transform='translate(-92.005848,-951.99999)'>
diff --git a/etc/images/outline-close.svg b/etc/images/outline-close.svg
index ea9157a5fb5..884514b9527 100644
--- a/etc/images/outline-close.svg
+++ b/etc/images/outline-close.svg
@@ -1,4 +1,9 @@
 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
+<style>
+  svg {
+    fill: currentColor;
+  }
+</style>
 <title>outline-close</title>
 <g transform="rotate(-90, 10, 10)">
 <path d="m17.5 4.75-7.5 7.5-7.5-7.5L1 6.25l9 9 9-9z"/>
diff --git a/etc/images/outline-open.svg b/etc/images/outline-open.svg
index 75cf6aff9f9..2dfcf8ea651 100644
--- a/etc/images/outline-open.svg
+++ b/etc/images/outline-open.svg
@@ -1,4 +1,9 @@
 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">
+<style>
+  svg {
+    fill: currentColor;
+  }
+</style>
 <title>outline-open</title>
 <path d="m17.5 4.75-7.5 7.5-7.5-7.5L1 6.25l9 9 9-9z"/>
 </svg>
diff --git a/etc/images/radio-checked.svg b/etc/images/radio-checked.svg
index 8950b447a0b..02a78238246 100644
--- a/etc/images/radio-checked.svg
+++ b/etc/images/radio-checked.svg
@@ -1,4 +1,9 @@
 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 16 16">
+  <style>
+    svg {
+      fill: currentColor;
+    }
+  </style>
   <g>
     <path d="M8 5a3.001 3.001 0 0 0 0 6 3.001 3.001 0 0 0 0 -6z" overflow="visible"/>
     <path d="M8.004 1C4.144 1 1 4.144 1 8.004c0 3.86 3.144 7.006 7.004 7.006 3.86 0 7.006-3.146 7.006-7.006C15.01 4.144 11.864 1 8.004 1zm0 1a6.002 6.002 0 0 1 6.006 6.004 6.004 6.004 0 0 1 -6.006 6.006A6.002 6.002 0 0 1 2 8.004 6 6 0 0 1 8.004 2z" overflow="visible"/>
diff --git a/etc/images/radio-mixed.svg b/etc/images/radio-mixed.svg
index 1b3bfa78e9d..74706c46ccd 100644
--- a/etc/images/radio-mixed.svg
+++ b/etc/images/radio-mixed.svg
@@ -1,4 +1,9 @@
 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 16 16">
+  <style>
+    svg {
+      fill: currentColor;
+    }
+  </style>
   <g>
     <path d="M8 1C4.142 1 1 4.142 1 8s3.142 7 7 7 7-3.142 7-7-3.142-7-7-7zm0 1c3.316 0 6 2.684 6 6s-2.684 6-6 6-6-2.684-6-6 2.684-6 6-6z" overflow="visible" />
     <path d="M5 6a2 2 0 1 0 0 4h6a2 2 0 1 0 0 -4z" overflow="visible" />
diff --git a/etc/images/radio.svg b/etc/images/radio.svg
index 2593a78610e..c95e71b0aca 100644
--- a/etc/images/radio.svg
+++ b/etc/images/radio.svg
@@ -1,3 +1,8 @@
 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 16 16">
+  <style>
+    svg {
+      fill: currentColor;
+    }
+  </style>
   <path d="M8 1C4.142 1 1 4.142 1 8s3.142 7 7 7 7-3.142 7-7-3.142-7-7-7zm0 1c3.316 0 6 2.684 6 6s-2.684 6-6 6-6-2.684-6-6 2.684-6 6-6z" overflow="visible" />
 </svg>
diff --git a/etc/images/reveal.svg b/etc/images/reveal.svg
index f950311ac5a..5d6e9a0d143 100644
--- a/etc/images/reveal.svg
+++ b/etc/images/reveal.svg
@@ -1,4 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
+    <style>
+      svg {
+        fill: currentColor;
+      }
+    </style>
     <path d="m 8 2 c -3.648438 0.003906 -6.832031 2.476562 -7.738281 6.007812 c 0.914062 3.527344 4.097656 5.988282 7.738281 5.992188 c 3.648438 -0.003906 6.832031 -2.476562 7.738281 -6.011719 c -0.914062 -3.523437 -4.097656 -5.984375 -7.738281 -5.988281 z m 0 2 c 2.210938 0 4 1.789062 4 4 s -1.789062 4 -4 4 s -4 -1.789062 -4 -4 s 1.789062 -4 4 -4 z m 0 2 c -1.105469 0 -2 0.894531 -2 2 s 0.894531 2 2 2 s 2 -0.894531 2 -2 s -0.894531 -2 -2 -2 z m 0 0"/>
 </svg>
diff --git a/etc/images/right.svg b/etc/images/right.svg
index 6c7d715939d..ca1790a2f38 100644
--- a/etc/images/right.svg
+++ b/etc/images/right.svg
@@ -22,6 +22,11 @@
       </cc:License>
     </rdf:RDF>
   </metadata>
+  <style>
+    svg {
+      fill: currentColor;
+    }
+  </style>
   <title id='title8473'>Gnome Symbolic Icons</title>
   <defs id='defs7386'/>
   <g inkscape:groupmode='layer' id='layer10' inkscape:label='ui' transform='translate(-112.00585,-951.99999)'>
diff --git a/etc/images/symbols/README b/etc/images/symbols/README
index ce3dd467554..bcce6fc1f98 100644
--- a/etc/images/symbols/README
+++ b/etc/images/symbols/README
@@ -41,3 +41,12 @@ E.g., arrow_right_circle_fill_16.
 Every time you modify the SVG icons, please use the ImageMagick
 `convert' utility to convert them to PBM icons, for the sake of
 Emacsen that cannot display SVG images.
+
+
+
+The behaviour described above for setting the foreground color to match
+the text has changed.  It must now be set to `currentcolor', so the
+above sed commands are now:
+
+sed -i 's/fill="none"/fill="currentcolor"/g' <file>
+sed -i 's/fill="black"/fille="currentcolor"/g' <file>
diff --git a/etc/images/symbols/check-mark_16.svg b/etc/images/symbols/check-mark_16.svg
index 10bf765f4d2..0eab96a2ede 100644
--- a/etc/images/symbols/check-mark_16.svg
+++ b/etc/images/symbols/check-mark_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path d="M6.58449 9.82778L3.75736 6.99807L2.3425 8.41164L6.58321 12.6562L13.6575 5.58837L12.2439 4.17351L6.58449 9.82778Z" />
 </svg>
diff --git a/etc/images/symbols/chevron_down_16.svg b/etc/images/symbols/chevron_down_16.svg
index 016e4a5720e..ef3dc6d0b95 100644
--- a/etc/images/symbols/chevron_down_16.svg
+++ b/etc/images/symbols/chevron_down_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path d="M14 4.5L14 7L8 12L2 7L2 4.5L8 9.5L14 4.5Z" />
 </svg>
diff --git a/etc/images/symbols/chevron_left_16.svg b/etc/images/symbols/chevron_left_16.svg
index 3f1d044c8ce..5cefc524b87 100644
--- a/etc/images/symbols/chevron_left_16.svg
+++ b/etc/images/symbols/chevron_left_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path d="M11 3.05H8.5L4 8.00001L8.5 13H11L6.5 8.00001L11 3.05Z" />
 </svg>
diff --git a/etc/images/symbols/chevron_right_16.svg b/etc/images/symbols/chevron_right_16.svg
index e2806c2a648..120ccec0186 100644
--- a/etc/images/symbols/chevron_right_16.svg
+++ b/etc/images/symbols/chevron_right_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path d="M4.95455 3H7.45455L12 8L7.45455 13H4.95455L9.5 8L4.95455 3Z" />
 </svg>
diff --git a/etc/images/symbols/chevron_up_16.svg b/etc/images/symbols/chevron_up_16.svg
index 1c4b9c47622..a4ad1efd9c3 100644
--- a/etc/images/symbols/chevron_up_16.svg
+++ b/etc/images/symbols/chevron_up_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path d="M2 11.5L2 9L8 4L14 9L14 11.5L8 6.5L2 11.5Z" />
 </svg>
diff --git a/etc/images/symbols/cross_16.svg b/etc/images/symbols/cross_16.svg
index f210cf230b6..e9d90601bbb 100644
--- a/etc/images/symbols/cross_16.svg
+++ b/etc/images/symbols/cross_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path d="M5.17157 3.75736L3.75736 5.17157L6.58579 8L3.75736 10.8284L5.17157 12.2426L8 9.41421L10.8284 12.2426L12.2426 10.8284L9.41421 8L12.2426 5.17157L10.8284 3.75736L8 6.58579L5.17157 3.75736Z" />
 </svg>
diff --git a/etc/images/symbols/cross_circle_16.svg b/etc/images/symbols/cross_circle_16.svg
index 1c05c7d8611..05f1294e4a8 100644
--- a/etc/images/symbols/cross_circle_16.svg
+++ b/etc/images/symbols/cross_circle_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path fill-rule="evenodd" clip-rule="evenodd" d="M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM13 8C13 10.7614 10.7614 13 8 13C5.23858 13 3 10.7614 3 8C3 5.23858 5.23858 3 8 3C10.7614 3 13 5.23858 13 8ZM9.76777 4.81802L11.182 6.23223L9.41421 8L11.182 9.76777L9.76777 11.182L8 9.41421L6.23223 11.182L4.81802 9.76777L6.58579 8L4.81802 6.23223L6.23223 4.81802L8 6.58579L9.76777 4.81802Z" />
 </svg>
diff --git a/etc/images/symbols/cross_circle_fill_16.svg b/etc/images/symbols/cross_circle_fill_16.svg
index 62da8aa5fda..839f293bf5c 100644
--- a/etc/images/symbols/cross_circle_fill_16.svg
+++ b/etc/images/symbols/cross_circle_fill_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path fill-rule="evenodd" clip-rule="evenodd" d="M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM10.1213 4.46447L11.5355 5.87868L9.41421 8L11.5355 10.1213L10.1213 11.5355L8 9.41421L5.87868 11.5355L4.46447 10.1213L6.58579 8L4.46447 5.87868L5.87868 4.46447L8 6.58579L10.1213 4.46447Z" />
 </svg>
diff --git a/etc/images/symbols/dot_large_16.svg b/etc/images/symbols/dot_large_16.svg
index dcc8eee380b..c00512054f7 100644
--- a/etc/images/symbols/dot_large_16.svg
+++ b/etc/images/symbols/dot_large_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <circle cx="8" cy="8" r="6" />
 </svg>
diff --git a/etc/images/symbols/dot_medium_16.svg b/etc/images/symbols/dot_medium_16.svg
index 18250ef12c6..9681d1a29ac 100644
--- a/etc/images/symbols/dot_medium_16.svg
+++ b/etc/images/symbols/dot_medium_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <circle cx="8" cy="8" r="4" />
 </svg>
diff --git a/etc/images/symbols/dot_small_16.svg b/etc/images/symbols/dot_small_16.svg
index 1d6a279b5dc..402b506c762 100644
--- a/etc/images/symbols/dot_small_16.svg
+++ b/etc/images/symbols/dot_small_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <circle cx="8" cy="8" r="2" />
 </svg>
diff --git a/etc/images/symbols/heart_16.svg b/etc/images/symbols/heart_16.svg
index 68bd767bd32..d602f97ccd7 100644
--- a/etc/images/symbols/heart_16.svg
+++ b/etc/images/symbols/heart_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path fill-rule="evenodd" clip-rule="evenodd" d="M8 5.5C8 5.5 9.5 3.5 11 3.5C12.5 3.5 14 4.5 14 6.5C14 10.1005 8 13.5 8 13.5C8 13.5 2 10.1005 2 6.5C2 4.5 3.34315 3.5 5 3.5C6.5 3.5 8 5.5 8 5.5ZM8 7.5C9 6.5 10 5.5 11 5.5C11.4898 5.5 11.738 5.65071 12 6C12.3515 6.46863 12.2982 7.40369 12 8C11 10 8 11.5 8 11.5C8 11.5 5 10 4 8C3.70858 7.41714 3.64853 6.46863 4 6C4.26197 5.65071 4.55933 5.5 5 5.5C6 5.5 7 6.5 8 7.5Z" />
 </svg>
diff --git a/etc/images/symbols/heart_fill_16.svg b/etc/images/symbols/heart_fill_16.svg
index e1a90a55742..86763c663cb 100644
--- a/etc/images/symbols/heart_fill_16.svg
+++ b/etc/images/symbols/heart_fill_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path d="M11 3.5C9.5 3.5 8 5.5 8 5.5C8 5.5 6.5 3.5 5 3.5C3.34315 3.5 2 4.5 2 6.5C2 10.1005 8 13.5 8 13.5C8 13.5 14 10.1005 14 6.5C14 4.5 12.5 3.5 11 3.5Z" />
 </svg>
diff --git a/etc/images/symbols/heart_half_16.svg b/etc/images/symbols/heart_half_16.svg
index 0ccdf620d33..d25f0820a8d 100644
--- a/etc/images/symbols/heart_half_16.svg
+++ b/etc/images/symbols/heart_half_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path fill-rule="evenodd" clip-rule="evenodd" d="M8 5.5C8 5.5 9.5 3.5 11 3.5C12.5 3.5 14 4.5 14 6.5C14 10.1005 8 13.5 8 13.5C8 13.5 2 10.1005 2 6.5C2 4.5 3.34315 3.5 5 3.5C6.5 3.5 8 5.5 8 5.5ZM12 8C11 10 8 11.5 8 11.5V7.5C9 6.5 10 5.5 11 5.5C11.4898 5.5 11.738 5.65071 12 6C12.3515 6.46863 12.2982 7.40369 12 8Z" />
 </svg>
diff --git a/etc/images/symbols/menu_16.svg b/etc/images/symbols/menu_16.svg
index bddc433b2eb..7882583f805 100644
--- a/etc/images/symbols/menu_16.svg
+++ b/etc/images/symbols/menu_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path fill-rule="evenodd" clip-rule="evenodd" d="M14 3H2V5H14V3ZM14 7H2V9H14V7ZM2 11H14V13H2V11Z" />
 </svg>
diff --git a/etc/images/symbols/minus_16.svg b/etc/images/symbols/minus_16.svg
index f0769763e5d..a4fa0b7ae39 100644
--- a/etc/images/symbols/minus_16.svg
+++ b/etc/images/symbols/minus_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path d="M12.5 7H3.5V9H12.5V7Z" />
 </svg>
diff --git a/etc/images/symbols/minus_circle_16.svg b/etc/images/symbols/minus_circle_16.svg
index ced8594774f..521c0448841 100644
--- a/etc/images/symbols/minus_circle_16.svg
+++ b/etc/images/symbols/minus_circle_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path fill-rule="evenodd" clip-rule="evenodd" d="M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM13 8C13 10.7614 10.7614 13 8 13C5.23858 13 3 10.7614 3 8C3 5.23858 5.23858 3 8 3C10.7614 3 13 5.23858 13 8ZM11.5 7V9H4.5V7H11.5Z" />
 </svg>
diff --git a/etc/images/symbols/minus_circle_fill_16.svg b/etc/images/symbols/minus_circle_fill_16.svg
index e298ccaa8b2..7ce8eeb459a 100644
--- a/etc/images/symbols/minus_circle_fill_16.svg
+++ b/etc/images/symbols/minus_circle_fill_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path fill-rule="evenodd" clip-rule="evenodd" d="M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM12 7V9H4V7H12Z" />
 </svg>
diff --git a/etc/images/symbols/plus_16.svg b/etc/images/symbols/plus_16.svg
index 573a5e5ca76..9445d7d4ada 100644
--- a/etc/images/symbols/plus_16.svg
+++ b/etc/images/symbols/plus_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path d="M9 3.5H7V7H3.5V9H7V12.5H9V9H12.5V7H9V3.5Z" />
 </svg>
diff --git a/etc/images/symbols/plus_circle_16.svg b/etc/images/symbols/plus_circle_16.svg
index 921857f5a84..9fc83e21d0b 100644
--- a/etc/images/symbols/plus_circle_16.svg
+++ b/etc/images/symbols/plus_circle_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path fill-rule="evenodd" clip-rule="evenodd" d="M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM13 8C13 10.7614 10.7614 13 8 13C5.23858 13 3 10.7614 3 8C3 5.23858 5.23858 3 8 3C10.7614 3 13 5.23858 13 8ZM7 7V4.5H9V7H11.5V9H9V11.5H7V9H4.5V7H7Z" />
 </svg>
diff --git a/etc/images/symbols/plus_circle_fill_16.svg b/etc/images/symbols/plus_circle_fill_16.svg
index 7f5de4ae3a8..47acabc93c9 100644
--- a/etc/images/symbols/plus_circle_fill_16.svg
+++ b/etc/images/symbols/plus_circle_fill_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path fill-rule="evenodd" clip-rule="evenodd" d="M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM7 7V4H9V7H12V9H9V12H7V9H4V7H7Z" />
 </svg>
diff --git a/etc/images/symbols/star_16.svg b/etc/images/symbols/star_16.svg
index 7ccbd6f01a5..8ad5e1db829 100644
--- a/etc/images/symbols/star_16.svg
+++ b/etc/images/symbols/star_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path fill-rule="evenodd" clip-rule="evenodd" d="M9.6458 5.73475L8 1L6.3542 5.73475L1.34261 5.83688L5.33704 8.86525L3.8855 13.6631L8 10.8L12.1145 13.6631L10.663 8.86525L14.6574 5.83688L9.6458 5.73475ZM8.70534 7.02918L8 5L7.29466 7.02918L5.14683 7.07295L6.85873 8.37082L6.23664 10.4271L8 9.2L9.76336 10.4271L9.14127 8.37082L10.8532 7.07295L8.70534 7.02918Z" />
 </svg>
diff --git a/etc/images/symbols/star_fill_16.svg b/etc/images/symbols/star_fill_16.svg
index 0e03675edd5..8e81e417f94 100644
--- a/etc/images/symbols/star_fill_16.svg
+++ b/etc/images/symbols/star_fill_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path d="M8 1L9.6458 5.73475L14.6574 5.83688L10.663 8.86525L12.1145 13.6631L8 10.8L3.8855 13.6631L5.33704 8.86525L1.3426 5.83688L6.3542 5.73475L8 1Z" />
 </svg>
diff --git a/etc/images/symbols/star_half_16.svg b/etc/images/symbols/star_half_16.svg
index 6c735ad64ae..9ea090d71ec 100644
--- a/etc/images/symbols/star_half_16.svg
+++ b/etc/images/symbols/star_half_16.svg
@@ -1,3 +1,4 @@
 <svg width="16" height="16" viewBox="0 0 16 16"  xmlns="http://www.w3.org/2000/svg">
+<style>svg {fill: currentColor;}</style>
 <path fill-rule="evenodd" clip-rule="evenodd" d="M9.72809 5.62149L8 1L6.27191 5.62149L1.34261 5.83688L5.2039 8.90851L3.8855 13.6631L8 10.94L12.1145 13.6631L10.7961 8.90851L14.6574 5.83688L9.72809 5.62149ZM10.3511 11.236L8 9.67997V3.99997L8.98747 6.64082L11.8042 6.7639L9.59777 8.51912L10.3511 11.236Z" />
 </svg>
diff --git a/etc/images/unchecked.svg b/etc/images/unchecked.svg
index 09bab8de95b..38d9436f8ae 100644
--- a/etc/images/unchecked.svg
+++ b/etc/images/unchecked.svg
@@ -1,3 +1,8 @@
 <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 16 16">
+  <style>
+    svg {
+      fill: currentColor;
+    }
+  </style>
   <path d="M3.5 1A2.506 2.506 0 0 0 1 3.5v9C1 13.876 2.124 15 3.5 15h9c1.376 0 2.5-1.124 2.5-2.5v-9C15 2.124 13.876 1 12.5 1zm0 1h9c.84 0 1.5 .66 1.5 1.5v9c0 .84-.66 1.5-1.5 1.5h-9c-.84 0-1.5-.66-1.5-1.5v-9C2 2.66 2.66 2 3.5 2z" overflow="visible" />
 </svg>
diff --git a/etc/images/up.svg b/etc/images/up.svg
index e358c29912b..b89deef748d 100644
--- a/etc/images/up.svg
+++ b/etc/images/up.svg
@@ -22,6 +22,11 @@
       </cc:License>
     </rdf:RDF>
   </metadata>
+  <style>
+    svg {
+      fill: currentColor;
+    }
+  </style>
   <title id='title8473'>Gnome Symbolic Icons</title>
   <defs id='defs7386'/>
   <g inkscape:groupmode='layer' id='layer10' inkscape:label='ui' transform='translate(-132.00585,-952)'>
diff --git a/src/image.c b/src/image.c
index 1d3faecf507..745668d4cd1 100644
--- a/src/image.c
+++ b/src/image.c
@@ -12265,7 +12265,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
     static char const wrapper[] =
       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" "
       "xmlns:xi=\"http://www.w3.org/2001/XInclude\" "
-      "style=\"color: #%06X; fill: currentColor;\" "
+      "style=\"color: #%06X;\" "
       "width=\"%d\" height=\"%d\" preserveAspectRatio=\"none\" "
       "viewBox=\"0 0 %f %f\">"
       "<rect width=\"100%%\" height=\"100%%\" fill=\"#%06X\"/>"
-- 
2.45.2