Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bookmarklet that makes pages dark, by applying white background to everything, then applying filter invert and grayscale
javascript:(function()%20{%20var%20tag%20=%20document.createElement('style');%20tag.type%20=%20'text/css';%20document.getElementsByTagName('head')[0].appendChild(tag);%20tag[%20(typeof%20document.body.style.WebkitAppearance=='string')%20?%20'innerText'%20:%20'innerHTML']%20=%20'*%20{%20background-color:%20white%20!important;%20color:%20#444%20!important;%20%20}%20html%20{%20filter:%20invert(100%)%20grayscale(100%);%20}';%20})();
@hamoid

This comment has been minimized.

Copy link
Owner Author

@hamoid hamoid commented Feb 6, 2016

Not perfect, it works on most pages, in some it works partially, and it GitHub somehow it does nothing! :)

@mmccall0813

This comment has been minimized.

Copy link

@mmccall0813 mmccall0813 commented Apr 10, 2019

If you want an always dark theme on Wikipedia and you have an account, you can go to "preferences", then "appearance", and next to the appearance you have selected, there will be a button called "Custom CSS" click that, then click "Create Page", and paste the following: html,img,video{-webkit-filter:invert(1)hue-rotate(180deg);filter:invert(1)hue-rotate(180deg)}body{background:#000}

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