logoalt Hacker News

WithinReason • today at 9:00 AM • 0 replies • view on HN

You can put this in a bookmark and click it on any site to swap light/dark:

    javascript:(function(){const id='_dark_mode_bm';const el=document.getElementById(id);if(el){el.remove();}else{const s=document.createElement('style');s.id=id;s.textContent='html{filter:invert(1) hue-rotate(180deg)!important;background:#fff!important;}img,video,canvas,picture,svg{filter:invert(1)%20hue-rotate(180deg)!important;}';document.head.appendChild(s);}})();
It does slow down page rendering on some browsers though