Skip to content

Instantly share code, notes, and snippets.

@r4dian
Created November 25, 2022 15:47
Show Gist options
  • Save r4dian/463413d71d809b39d4fb00737c196d96 to your computer and use it in GitHub Desktop.
Save r4dian/463413d71d809b39d4fb00737c196d96 to your computer and use it in GitHub Desktop.
Make any website have a dark mode, by saving each of these 3 lines as a bookmarklet.
// dimmer
javascript:var style=document.createElement('style');style.innerText='html{filter:saturate(25%) invert(80%) brightness(80%)}img{filter:invert(100%);}';var head=document.getElementsByTagName('head')[0];head.appendChild(style);
// less dim, but still inverted
javascript:var style=document.createElement('style');style.innerText='html{filter:saturate(33%) invert(90%);}img{filter:invert(100%);}';var head=document.getElementsByTagName('head')[0];head.appendChild(style);
// undo dimmer
javascript:var style=document.createElement('style');style.innerText='html{filter:saturate(100%) invert(0%) brightness(100%);}img{filter:invert(0%);}';var head=document.getElementsByTagName('head')[0];head.appendChild(style);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment