Last active
July 11, 2024 15:25
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
invoked as IIFE - Immediately Invoked Function Expression, more info here