https://en.wikipedia.org/wiki/Wikipedia:Dark_mode_(gadget)?w...
from a quick glance it adds
invert(1) hue-rotate(180deg)
to HTML style. What indeed works, but is a bit sloppy way to do a dark mode. Making usable colour palate and adjusting typography for inverted mode takes little more effort, sadly. document.documentElement.classList.add('skin-theme-clientpref-os')
It looks very similar to the invert one, but has way better colouring of the code blocks and box titles, from a quick glance.The palette overrides for `prefers-color-scheme:dark` can be found in https://en.wikipedia.org/w/load.php?lang=en&modules=ext.uls....
[1] https://userstyles.world/style/17/wikipedia-dark [2] https://github.com/StylishThemes/Wikipedia-Dark/blob/master/...
If we're going to be indiscriminately inverting colors and trying to piece the page back together anyway, I strongly recommend using Dark Reader [0] instead and getting the benefits of this globally. It's open source and very good. I installed it when I first got an Android phone that supported dark mode and haven't even really noticed it since then, it's just as though every webpage in the world started respecting my phone's global dark mode toggle.