From: Alan Third Date: Sun, 4 May 2025 18:08:00 +0000 (+0100) Subject: Use css to set SVG foreground in docview X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8576072d3d2dbeffb849fe66a3957b20c7734f20;p=emacs.git Use css to set SVG foreground in docview * lisp/doc-view.el (doc-view-insert-image): Use CSS to set the fill attribute to the desired foreground color. (cherry picked from commit 8b200c041924904074b996addaec0b4ccfb1a024) --- diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 461e109ef74..ff0d8ee4703 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1674,7 +1674,8 @@ ARGS is a list of image descriptors." (setq args `(,@args :transform-smoothing t))) (when (eq doc-view--image-type 'svg) (setq args `(,@args :background ,(face-background 'doc-view-svg-face) - :foreground ,(face-foreground 'doc-view-svg-face)))) + :foreground ,(face-foreground 'doc-view-svg-face) + :css "svg{fill:currentcolor;}"))) (apply #'create-image file doc-view--image-type nil args)))) (slice (doc-view-current-slice)) (img-width (and image (car (image-size image))))