Skip to content

Instantly share code, notes, and snippets.

@jrwarwick
Last active June 6, 2026 05:50
Show Gist options
  • Select an option

  • Save jrwarwick/79ca363e63cebf5d2294de54bb183347 to your computer and use it in GitHub Desktop.

Select an option

Save jrwarwick/79ca363e63cebf5d2294de54bb183347 to your computer and use it in GitHub Desktop.
Bookmarklet: Universal Darkmode
javascript:(function(){ if(window.darkModeEnabled) { document.documentElement.style.removeProperty('filter'); window.darkModeEnabled = false; }else{ document.documentElement.style.setProperty('filter','invert(90%) hue-rotate(180deg)','important'); window.darkModeEnabled = true; document.querySelectorAll('img').forEach(img => img.style.setProperty('filter','invert(90%) hue-rotate(180deg)','important')); }})();
@jrwarwick

jrwarwick commented Jun 6, 2026

Copy link
Copy Markdown
Author

Not my work, but from: https://winstonbrown.me/blog/google-docs-dark-mode/
I have seen many, but this guy's is genius and is by far the most pleasant to the eye and easiest to read. I did add in a partial fix for the "imgs get inverted, too" problem.

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