I guess in theory we could parse svgs to see if it has media queries (like we do for lang), render them separately, use a <picture> tag with a media attribute to change the source depending on color mode. But that all sounds really complicated.
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 regardsDoc 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>:This is the file: https://ru.wikipedia.org/wiki/Файл:Moscow_metro_map_sb_ .local_draft.svg This is gray on gray in the dark mode: https://commons.wikimedia.org/wiki/File:Russian_Wikipedia_ Шаблон-Интерактивная_схема_ Московского_метрополитена- песочница_2024-07-02_19-12-32. png בתאריך יום ג׳, 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 here. This 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/