Feature #971
Dark theme support
Start date:
02/19/2015
Due date:
% Done:
100%
History
#1 Updated by Luke Murphey almost 10 years ago
I found some information on how to do this:
- http://stackoverflow.com/questions/4766201/javascript-invert-color-on-all-elements-of-a-page
- http://jsfiddle.net/jVKw6/8/
- http://tonymuka.com/js/
- https://gist.github.com/paulirish/373253
This worked well for me:
invert_colors = function() { // the css we are going to inject var css = 'html {-webkit-filter: invert(100%);' + '-moz-filter: invert(100%);' + '-o-filter: invert(100%);' + '-ms-filter: invert(100%); }', head = document.getElementsByTagName('head')[0], style = document.createElement('style'); // a hack, so you can "invert back" clicking the bookmarklet again if (!window.counter) { window.counter = 1;} else { window.counter ++; if (window.counter % 2 == 0) { var css ='html {-webkit-filter: invert(0%); -moz-filter: invert(0%); -o-filter: invert(0%); -ms-filter: invert(0%); }'} }; style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } //injecting the css to the head head.appendChild(style); } invert_colors();
#2 Updated by Luke Murphey almost 10 years ago
Might want to hide scroll bars too since they stay white.
#4 Updated by Luke Murphey almost 10 years ago
It looks like this isn't supported in FireFox.
#5 Updated by Luke Murphey almost 10 years ago
- Status changed from New to Closed
- Target version set to 2.1
- % Done changed from 0 to 100