MediaWiki:Common.js: Difference between revisions

From Winds Of Valen Wiki
Jump to navigation Jump to search
Force light mode
Force light mode
Line 1: Line 1:
/* Force browser to render in light mode - prevents Dark Reader and OS dark mode from inverting colors */
/* Force light color scheme to prevent dark mode extensions from inverting colors */
(function() {
(function () {
     var meta = document.createElement('meta');
     var m = document.createElement('meta');
     meta.name = 'color-scheme';
     m.name = 'color-scheme';
     meta.content = 'light only';
     m.content = 'light only';
     document.head.insertBefore(meta, document.head.firstChild);
     document.head.insertBefore(m, document.head.firstChild);
})();
    document.documentElement.style.colorScheme = 'light';
}());

Revision as of 00:47, 11 July 2026

/* Force light color scheme to prevent dark mode extensions from inverting colors */
(function () {
    var m = document.createElement('meta');
    m.name = 'color-scheme';
    m.content = 'light only';
    document.head.insertBefore(m, document.head.firstChild);
    document.documentElement.style.colorScheme = 'light';
}());