MediaWiki:Common.js: Difference between revisions
From jugglingpatterns
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
import("/js/animation.js"); |
import("/js/animation.js"); |
||
import("/js/darkreader/darkreader.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(); |
Revision as of 13:57, 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();