MediaWiki:Gadget-dark-mode-toggle.js: Difference between revisions

Content deleted Content added
add IF wrapper for darkmode-turn-on-label; requested on talk
sync update requested from User:TheDJ/Gadget-dark-mode-toggle.js
Line 25:
// For others, update Gadget-dark-mode.css directly which is loaded without FOUCs
document.documentElement.classList.add('client-dark-mode');
// Update the initial minerva theme-color
$('meta[name="theme-color"]').attr('content', '#000000');
}
 
Line 48 ⟶ 51:
$(labelSelector).text(mw.msg('darkmode-turn-' + onOrOff + '-label'));
$('#pt-darkmode a').attr('title', mw.msg('darkmode-turn-' + onOrOff + '-tooltip'));
// Update the minerva theme-color
$('meta[name="theme-color"]').attr('content', newState ? '#000000' : '#eaecf0' );
 
// Modify the <link> element on the page to include/exclude dark-mode styles