MediaWiki:Common.js: Difference between revisions

From jugglingpatterns
No edit summary
No edit summary
Line 10: Line 10:
DarkReader.auto(false);
DarkReader.auto(false);
// Get the generated CSS of Dark Reader returned as a string.
// Get the generated CSS of Dark Reader returned as a string.
var CSS = await DarkReader.exportGeneratedCSS();
var CSS = DarkReader.exportGeneratedCSS();
// Check if Dark Reader is enabled.
// Check if Dark Reader is enabled.
const isEnabled = DarkReader.isEnabled();
const isEnabled = DarkReader.isEnabled();

Revision as of 14:01, 16 November 2023

// use by using Template:AnimateSiteswap which provides the matching html
import("/js/animation.js");
import("/js/darkreader/darkreader.js");

DarkReader.enable({ brightness: 100, contrast: 90,    sepia: 10 });
DarkReader.disable();
// Enable when the system color scheme is dark.
DarkReader.auto({    brightness: 100,    contrast: 90,    sepia: 10 });
// Stop watching for the system color scheme.
DarkReader.auto(false);
// Get the generated CSS of Dark Reader returned as a string.
var CSS =  DarkReader.exportGeneratedCSS();
// Check if Dark Reader is enabled.
const isEnabled = DarkReader.isEnabled();