Skip to content

Instantly share code, notes, and snippets.

@ganeshkumarm1
Last active August 4, 2020 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ganeshkumarm1/69039d06017c188b307764455586860b to your computer and use it in GitHub Desktop.
Save ganeshkumarm1/69039d06017c188b307764455586860b to your computer and use it in GitHub Desktop.
Dark Theme for Medium
// Dark Theme for Medium Web
let dark = "#191919";
let light = "#FAFAFA" ;
let mark = "#212121";
document.querySelectorAll('svg').forEach(e => e.style.fill = light);
document.querySelector("nav").style.backgroundColor = dark;
document.querySelectorAll("nav div").forEach(e => e.style.backgroundColor = dark);
document.querySelectorAll("article").forEach(e => e.style.backgroundColor = dark);
document.querySelectorAll("#root > div > article > div section")
.forEach(e => e.style.backgroundColor = dark);
document.querySelectorAll("#root > div > article > div hr")
.forEach(e => e.style.backgroundColor = dark);
document.querySelectorAll("#root > div > article > div hr")
.forEach(e => e.style.color = light);
document.querySelectorAll('p').forEach(e => e.style.color = light);
document.querySelectorAll('strong').forEach(e => e.style.color = light);
document.querySelectorAll('li').forEach(e => e.style.color = light);
document.querySelectorAll('mark').forEach(e => e.style.color = mark);
document.querySelectorAll('h1').forEach(e => e.style.color = light);
document.querySelectorAll('h2').forEach(e => e.style.color = light);
document.querySelectorAll('h3').forEach(e => e.style.color = light);
document.querySelectorAll('h4').forEach(e => e.style.color = light);
document.querySelectorAll('h5').forEach(e => e.style.color = light);
document.querySelectorAll('h6').forEach(e => e.style.color = light);
document.querySelectorAll('span h6').forEach(e => e.style.color = light);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment