MediaWiki:Common.js: Difference between revisions

From jugglingpatterns
No edit summary
No edit summary
Line 3: Line 3:
import("/js/darkreader/darkreader.js");
import("/js/darkreader/darkreader.js");


DarkReader.enable({
DarkReader.enable({ brightness: 100, contrast: 90, sepia: 10 });
brightness: 100,
contrast: 90,
sepia: 10
});

DarkReader.disable();
DarkReader.disable();

// Enable when the system color scheme is dark.
// Enable when the system color scheme is dark.
DarkReader.auto({
DarkReader.auto({ brightness: 100, contrast: 90, sepia: 10 });
brightness: 100,
contrast: 90,
sepia: 10
});

// Stop watching for the system color scheme.
// Stop watching for the system color scheme.
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.
const CSS = await DarkReader.exportGeneratedCSS();
const CSS = await 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 13:59, 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.
const CSS = await DarkReader.exportGeneratedCSS();
// Check if Dark Reader is enabled.
const isEnabled = DarkReader.isEnabled();