Skip to content

Instantly share code, notes, and snippets.

@eevmanu
Last active July 11, 2024 15:25
Show Gist options
  • Save eevmanu/cc748a4d0eac644bd632a08d7f32ce31 to your computer and use it in GitHub Desktop.
Save eevmanu/cc748a4d0eac644bd632a08d7f32ce31 to your computer and use it in GitHub Desktop.
script to execute on "chrome dev tools - console tab" to easily dark mode any page
(function() {
var css = `
body {
background: white;
}
html {
filter: invert(100%) hue-rotate(180deg);
}
img {
filter: invert(100%) hue-rotate(180deg);
}
video {
filter: invert(100%) hue-rotate(180deg);
}
`;
var style = document.createElement('style');
style.appendChild(document.createTextNode(css));
document.head.appendChild(style);
})();
@eevmanu
Copy link
Author

eevmanu commented Jul 11, 2024

invoked as IIFE - Immediately Invoked Function Expression, more info here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment