Today,
User:Volker E. (WMF)/dark-mode.js is a topic that generates great interest and debate in society. As we move forward in the digital age,
User:Volker E. (WMF)/dark-mode.js has become a relevant point of discussion in different areas. From politics to fashion, through science and technology,
User:Volker E. (WMF)/dark-mode.js has established itself as a crucial issue that marks the development and evolution of our society. In this article, we will explore in detail the different facets and perspectives related to
User:Volker E. (WMF)/dark-mode.js, analyzing its impact on various aspects of our daily lives and offering a broad overview to understand its importance in the current context.
/*
* WikimediaUI Dark Mode
*
* Original authors:
* - Volker E. (Wikimedia Foundation Product Design)
* - Alex Hollender (Wikimedia Foundation Product Design)
* - Ed Sanders
* - MusikAnimal
*
* Last updated: 2020-04-24
*/
// Load dependencies (remove when loading through ResourceLoader).
mw.loader.load( 'https://en.wikipedia.org/w/index.php?title=User:Volker_E._(WMF)/dark-mode.css&action=raw&ctype=text/css', 'text/css' );
// User has dark color scheme preference set in operating system.
if ( window.matchMedia( '( prefers-color-scheme: dark )' ).matches || mw.storage.get( 'client-dark-mode-toggle' ) === '1' ) {
document.documentElement.className = 'client-dark-mode';
}
$( function () {
// Fix logos.
$( '#p-logo' ).clone().addClass( 'mw-no-invert' ).insertAfter( '#p-logo' );
mw.util.addPortletLink( 'p-personal', '#', 'Dark mode', 'pt-darkmode', '', 'np', '#pt-watchlist' );
$( '#pt-darkmode' ).on( 'click', function( e ) {
var $html = $( 'html' );
e.preventDefault();
$html.toggleClass( 'client-dark-mode' );
mw.storage.set(
'client-dark-mode-toggle',
String( Number( $html.hasClass( 'client-dark-mode' ) ) )
);
} );
} );