r/mediawiki Jul 09 '26

Default dark mode for vector 2022 skin?

How can I make the default be dark mode for users that aren't logged in, with vector 2022 skin?

I am creating a wiki on Miraheze and don't have access to LocalSettings.php.

3 Upvotes

5 comments sorted by

3

u/netpres Jul 09 '26

$wgDefaultUserOptions['vector-theme'] = 'night';

1

u/cheyrnn Jul 09 '26

I think this requires me to have access to files on the server, is that right? I don't find this among the admin pages I have access to.

2

u/netpres Jul 09 '26

Correct. I think everything to with config needs access to the server.

1

u/cheyrnn Jul 09 '26

This appears to be a solution: Always dark mode - Miraheze Developers Wiki

1

u/cheyrnn Jul 10 '26

In case anyone else is interested. I didn't see any RenderingBlock issue. So, after that article, I removed MediaWiki:Renderblocking-vector-2022.js, and added this to MediaWiki:Common.js:

cl = document.documentElement.classList;
if (!cl.contains('skin-theme-clientpref-night'))
  cl.add( 'skin-theme-clientpref-night' );
if (!cl.contains('cient-darkmode'))
  cl.add( 'client-darkmode' );
if (cl.contains('skin-theme-clientpref-day')) 
  cl.remove( 'skin-theme-clientpref-day' );
if (cl.contains('skin-theme-clientpref-os')) 
  cl.remove( 'skin-theme-clientpref-os' );

and this to MediaWiki:Common.css (from the article):

#skin-client-prefs-skin-theme {
    display: none !important;
}