Skip to content

Instantly share code, notes, and snippets.

@alexschreyer
Last active December 11, 2025 02:20
Show Gist options
  • Select an option

  • Save alexschreyer/9bf25bda28b80b87af667471201bfcd0 to your computer and use it in GitHub Desktop.

Select an option

Save alexschreyer/9bf25bda28b80b87af667471201bfcd0 to your computer and use it in GitHub Desktop.
A simple bookmarklet to apply dark mode to any webpage.
javascript:(function() {
var css='
body {
background-color: #000 !important; color: #eee !important;
}
*:not(body, table, em) {
background-color: rgba(50, 50, 50, 0.5) !important; border-color: rgba(255, 255, 255, 0.5) !important; color: #eee !important;
}
h1, h2, h3, h4, h5, h6, p {
color: #eee !important; background: none !important;
}
a {
color: #99c3ff !important; background: none !important;
}
a:hover {
color: #eee !important;
}
img, video {
filter: brightness(0.8) contrast(1.2);
}
';
var style=document.createElement('style');
style.type='text/css';
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