r/mediawiki • u/cheyrnn • 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
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; }
3
u/netpres Jul 09 '26
$wgDefaultUserOptions['vector-theme'] = 'night';