Search code examples
mediawikiwikipediadarkmode

Enabling dark mode in MediaWiki installation


On a relatively fresh installation of the latest MediaWiki on a standard LAMP setup, everything works great, except I can't get dark mode working.

On the MediaWiki Dark Mode page it is claimed that for Vector 2022, my current skin, I can activate it by appending the query paramter ?vectornightmode=1 to a URL. Works great on Wikipedia, but not on my own installation. Also, it starts out by saying I can use CSS custom properties to define a dark mode palette, but really, I just want the same experience as I have on Wikipedia, where I can enable it in settings, and use an established dark mode palette, without having to patch together my own.

I wondered about whether I might need to install a dark mode gadget, but on the Skins with dark mode page, where Vector 2022 is listed, it is said that

This category is for skins that support a dark mode experience without additional setup required such as Extension:DarkMode or gadgets

So, what's the way to do this?

It's strange how, on that dark mode page, they hop between what looks like advice for skin authors, and instructions for enabling dark mode in bundled skins, and especially strange that there isn't a clear, step-by-step guide on how to enable dark mode on a vanilla MediaWiki installation.


Solution

  • I was also searching for this and I agree that this information is not clearly presented anywhere. The dark mode page is not clear at all.

    In my case, I'm using the following versions:

    • MediaWiki: 1.42.1 (not sure about the date, somewhere around 27-06-2024)
    • MinervaNeue: – (6b1d02c) 08:07, 15 August 2024 (mobile theme, has dark mode)
    • Vector: 1.0.0 (6d89628) 08:07, 15 August 2024 (no dark mode)

    The English Wikipedia currently uses (see https://en.wikipedia.org/wiki/Special:Version):

    • MediaWiki: 1.43.0-wmf.18 (38066e5) 00:30, 13 August 2024
    • MinervaNeue: – (ad9f7b5) 09:25, 12 August 2024 (mobile theme, has dark mode)
    • Vector: 1.0.0 (534a4b2) 09:25, 12 August 2024 (has dark mode)

    So my theme versions are newer (you can check your own via the Special:Version page), however, my MediaWiki version is older.

    I've found this comment by gymate1 on a Reddit post (https://www.reddit.com/r/mediawiki/comments/pn46sy/comment/lcn3ypm/):

    Dark mode will be available for the Vector 2022 skin in the 1.43 release in December 2024. (Minerva Neue already has it.)

    With a link to the Dark mode wiki page. The highlighted text from their link is no longer on that Wiki page but it said:

    a desktop web version for the Vector 2022 skin will follow in mid-July 2024

    So to summarize, it is not completely clear to me, but it seems that dark mode is coming in the next version.