Created
February 6, 2016 10:32
-
-
Save hamoid/316787ebcbc1d929f9da to your computer and use it in GitHub Desktop.
Bookmarklet that makes pages dark, by applying white background to everything, then applying filter invert and grayscale
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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})(); |
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
Not perfect, it works on most pages, in some it works partially, and it GitHub somehow it does nothing! :)