User:Ahmad252/dark-mode.js

Hello, you have come here looking for the meaning of the word User:Ahmad252/dark-mode.js. In DICTIOUS you will not only get to know all the dictionary meanings for the word User:Ahmad252/dark-mode.js, but we will also tell you about its etymology, its characteristics and you will know how to say User:Ahmad252/dark-mode.js in singular and plural. Everything you need to know about the word User:Ahmad252/dark-mode.js you have here. The definition of the word User:Ahmad252/dark-mode.js will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofUser:Ahmad252/dark-mode.js, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
/* Copied from ]
/* 
 * WikimediaUI Dark Mode
 *
 * Original authors:
 * - Alex Hollender
 * - Volker E.
 * - Ed Sanders
 * - MusikAnimal
 *
 * Last updated: 2019-09-18
 */

importStylesheet( 'User:Ahmad252/dark-mode.css' );
// User has dark color scheme preference set in OS.
if ( window.matchMedia( '( prefers-color-scheme: dark )' ).matches || mw.storage.get( 'client-dark-mode-toggle' ) === '1' ) {
	document.documentElement.className = 'client-dark-mode';
}

$( function () {
	// Fix logo globe.
	$( '#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' ) ) )
		);
    });
} );