I think what is needed here is native SVG rendering which is a long requested but tricky problem:
https://phabricator.wikimedia.org/T208578

In the mean time unfortunately this can only be resolved by the icky approach of rendering two SVGs or adding CSS filters to the image in the article to flip the colors. You can do this with the skin-invert or skin-invert-image classes which are documented on the page Christopher Cuifo linked to already.


On Wed, Jul 3, 2024, 11:05 PM Brian Wolff <bawolff@gmail.com> wrote:
I think it is unlikely MediaWiki will be modified in such a way to show different images between light and dark mode. (I assume) we generally want to avoid having to split the parser cache between light mode/dark mode.

I guess you could use template styles to display:none one of the images depending on mode, but that seems pretty icky.

--
Bawolff


On Wednesday 3 July 2024, Martin Domdey <dr.taxon@gmail.com> wrote:
Hi!

But it's not that point. An svg is a graphic image file. Colors shouldn't be changed by dark mode enhanced. You can't see other dark images and pictures on dark background, too. An svg with coded colors can show the wrong colors, when they are changed by dark mode enhanced. 

I have one option in my mind. Code an svg file for light mode and an svg file for dark mode and change the Mediawiki software in that manner, to read whether dark mode is enhanced or not and then select the correct svg file. I can't do that, I guess it needs a phabricator task.

(I hope you can read and understand this, my technical English is not the best.)

Kind regards
Doc Taxon ...

‪Am Mi., 3. Juli 2024 um 12:46 Uhr schrieb ‫יגאל חיטרון‬‎ <khitron@post.bgu.ac.il>:‬
Well, I'm giving up. I tryed a dozen of options, and nothing helps. This file will remain the same in the dark mode. Thank you for trying.
Igal


בתאריך יום ד׳, 3 ביולי 2024, 00:04, מאת יגאל חיטרון ‏<khitron@post.bgu.ac.il>:

‫בתאריך יום ג׳, 2 ביולי 2024 ב-23:57 מאת ‪Chris Ciufo‬‏ <‪cciufo@wikimedia.org‬‏>:‬
Hi IKhitron, are you able to provide a link to the svg in question so that more specific guidance can be given?

In case you haven't seen it, there are specific recommendations for making content compatible with dark mode on wiki hereThis section about dark images with transparent backgrounds might be the most useful to you.

I saw, of course, but it's definitely not an icon. Thank you.
Igal

On Tue, Jul 2, 2024 at 3:50 PM Igal Khitron <khitron@gmail.com> wrote:
Hello. Is there a chance anybody knows a codex variable color that is gray in regular, and much darker in the dark mode? I'm looking for a way to adjust an svg file to the Mediawiki dark mode, and I have some gray text on white background that can't remain gray on gray background, it should have a good contrast to be readable. Unfortunately, we couldn't find a way to change the colors of the .svg file itself (not .svg.png) for the dark mode. Thank you.
Igal
(User:IKhitron)

_______________________________________________
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/


--
Christopher Ciufo (He/him)
Senior Product Manager, Platform
Wikimedia Foundation
_______________________________________________
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
_______________________________________________
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/
_______________________________________________
Wikitech-l mailing list -- wikitech-l@lists.wikimedia.org
To unsubscribe send an email to wikitech-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/wikitech-l.lists.wikimedia.org/